Converted bzero() into memset() which is no Linuxism anymore and also
authorJoey Schulze <joey@infodrom.org>
Sat, 17 Nov 2001 23:12:42 +0000 (23:12 +0000)
committerJoey Schulze <joey@infodrom.org>
Sat, 17 Nov 2001 23:12:42 +0000 (23:12 +0000)
available on other *nix systems or a Cygwin environment.

bigint.c
dtaus.c

index 059c71b..38511aa 100644 (file)
--- a/bigint.c
+++ b/bigint.c
@@ -1,6 +1,6 @@
 /*
     bigint.c - Manage big positive integer numbers
-    Copyright (c) 1996  Martin Schulze <joey@artis.uni-oldenburg.de>
+    Copyright (c) 1996,2001  Martin Schulze <joey@artis.uni-oldenburg.de>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -95,7 +95,7 @@ void bigint_sprintf (char *res, char *format, bigint a)
   char form[6];
   int i, max;
 
-  bzero(s, sizeof(s));
+  memset (s, 0, sizeof(s));
   sprintf(form, "%%0%dlu", BIGINT_PREC);
   max = BIGINT_LEN;
   for (;max>0 && !a.val[max-1];max--);
diff --git a/dtaus.c b/dtaus.c
index e19732d..c1e5727 100644 (file)
--- a/dtaus.c
+++ b/dtaus.c
@@ -148,7 +148,7 @@ dtaus_record recE[] = {
 
 size_t dtaus_nextrec (void **buf, FILE *f)
 {
-  bzero (buf, 128);
+  memset (buf, 0, 128);
   return fread(buf, 128, 1, f);
 }
 
@@ -440,8 +440,8 @@ size_t control_nextline (void **buf, int len, FILE *f)
   char *cp;
   int i;
 
-  bzero (line, sizeof(line));
-  bzero (buf, len);
+  memset (line, 0, sizeof(line));
+  memset (buf, 0, len);
   cp = line;
 
   while (!strlen(line) && (cp = fgets(line, 100, f))) {
@@ -494,7 +494,7 @@ void dtaus_prepareA (char *buf)
   struct tm *loctime;
   char tmp[10];
 
-  bzero (buf, 129);
+  memset (buf, 0, 129);
   timer = time ( NULL );
   loctime = localtime(&timer);
 
@@ -528,7 +528,7 @@ void dtaus_prepareC (char *buf, int normaltext, int maxtext)
   int i;
   int appendix = 0;
 
-  bzero (buf, 257);
+  memset (buf, 0, 257);
 
   if (normaltext)
     appendix = 1;
@@ -576,7 +576,7 @@ void dtaus_prepareE (char *buf)
 {
   int i;
 
-  bzero (buf, 129);
+  memset (buf, 0, 129);
   buf[0] = '0';
   buf[1] = '1';
   buf[2] = '2';
@@ -897,7 +897,7 @@ void dtaus2control (char *cdtaus, char *ccontrol)
        }
       }
       if (dtaus_nextrec(buf, fdtaus) != 1)
-       bzero (buf, sizeof(buf));
+       memset (buf, 0, sizeof(buf));
 
       /*
        * Are there extension records that we have to check?
@@ -916,7 +916,7 @@ void dtaus2control (char *cdtaus, char *ccontrol)
          }
        }
        if (dtaus_nextrec(buf, fdtaus) != 1)
-         bzero (buf, sizeof(buf));
+         memset (buf, 0, sizeof(buf));
        extC--;
       }
       fprintf(fcontrol, "}\n");
@@ -1021,7 +1021,7 @@ int control2dtaus (char *ccontrol, char *cdtaus, char *cbeleg, char *ccheck)
   /* 
    * Record A lesen
    */
-  bzero(valA, sizeof(valA));
+  memset (valA, 0, sizeof(valA));
   control_nextline ((void *)line, 100, fcontrol);
   ident = extract_ident(line);
   if (!strcmp(ident, "begin") && (line[0] == '{')) {
@@ -1102,7 +1102,7 @@ int control2dtaus (char *ccontrol, char *cdtaus, char *cbeleg, char *ccheck)
   sum_val = bigint_int(0);
   sum_blz = bigint_int(0);
   sum_kto = bigint_int(0);
-  bzero(valC, sizeof(valC));
+  memset (valC, 0, sizeof(valC));
   control_nextline ((void *)line, 100, fcontrol);
   if (line[0] == '{') {
     while (strlen(line) && line[0] == '{') {
@@ -1158,7 +1158,7 @@ int control2dtaus (char *ccontrol, char *cdtaus, char *cbeleg, char *ccheck)
       for (recindex=0; recindex<C_LEN; recindex++)
        if (valC[recindex])
          free(valC[recindex]);
-      bzero(valC, sizeof(valC));
+      memset (valC, 0, sizeof(valC));
       control_nextline ((void *)line, 100, fcontrol);
     }
   } else {