X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=client%2Ffhistory.c;h=cb92730f6dc5b449804f4c0a64f6b8da6a27c3c6;hp=202593958a170d5da6b42f240918e6c9efef18c7;hb=7ac6428937b4b235b59446ea7ca3f13a0378ed5c;hpb=c81c923c94d47c16308d487de3431f5027059522 diff --git a/client/fhistory.c b/client/fhistory.c index 2025939..cb92730 100644 --- a/client/fhistory.c +++ b/client/fhistory.c @@ -1,17 +1,19 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ /** \file fhistory.c * \brief file history implementation */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include #include #include -#include #if HAVE_SYS_TYPES_H #include #endif @@ -76,7 +78,7 @@ int file_history_save(file_history_t fh) char* homedir = getenv("HOME"); char fname[1024]; int ret = 0; - int sz = wrbuf_len(fh->wr); + size_t sz = wrbuf_len(fh->wr); if (!sz) return 0; @@ -116,11 +118,11 @@ int file_history_save(file_history_t fh) int file_history_trav(file_history_t fh, void *client_data, void (*callback)(void *client_data, const char *line)) { - int off = 0; + size_t off = 0; while (off < wrbuf_len(fh->wr)) { - int i; + size_t i; for (i = off; i < wrbuf_len(fh->wr); i++) { if (wrbuf_buf(fh->wr)[i] == '\n') @@ -140,6 +142,7 @@ int file_history_trav(file_history_t fh, void *client_data, /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab