X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Ftrav.c;h=c3e8c4962c612dd85cab6a425ebd1faa433bb9fa;hb=7e928bc31abe214023a0fc61d77b092f4ee9ba7e;hp=4accc882638042d62975f74ab4e33296d9c14ef2;hpb=b879b04a092d5b00cc866cf16f755e55053d2e89;p=idzebra-moved-to-github.git diff --git a/index/trav.c b/index/trav.c index 4accc88..c3e8c49 100644 --- a/index/trav.c +++ b/index/trav.c @@ -1,10 +1,17 @@ /* - * Copyright (C) 1995, Index Data I/S + * Copyright (C) 1994-1995, Index Data I/S * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: trav.c,v $ - * Revision 1.2 1995-09-04 12:33:43 adam + * Revision 1.4 1995-09-28 09:19:46 adam + * xfree/xmalloc used everywhere. + * Extract/retrieve method seems to work for text records. + * + * Revision 1.3 1995/09/06 16:11:18 adam + * Option: only one word key per file. + * + * Revision 1.2 1995/09/04 12:33:43 adam * Various cleanup. YAZ util used instead. * * Revision 1.1 1995/09/01 14:06:36 adam @@ -71,11 +78,7 @@ void copy_file (const char *dst, const char *src) logf (LOG_FATAL|LOG_ERRNO, "Cannot open %s", src); exit (1); } - if (!(buf = malloc (4096))) - { - logf (LOG_FATAL|LOG_ERRNO, "malloc"); - exit (1); - } + buf = xmalloc (4096); while ((r=read (s_fd, buf, 4096))>0) for (w = 0; w < r; w += i) { @@ -91,7 +94,7 @@ void copy_file (const char *dst, const char *src) logf (LOG_FATAL|LOG_ERRNO, "read"); exit (1); } - free (buf); + xfree (buf); close (d_fd); close (s_fd); }