OSSP CVS Repository

ossp - Difference in ossp-pkg/sio/al_test.c versions 1.15 and 1.16
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/sio/al_test.c 1.15 -> 1.16

--- al_test.c    2002/10/23 16:49:29     1.15
+++ al_test.c    2002/11/05 14:52:24     1.16
@@ -46,10 +46,11 @@
 static const char *fill(char *p, int n)
 {
     static char buf[4 * 80 + 1];
+    int max = sizeof(buf)-5;
     int k;
 
     k=0;
-    while (n > 0 && k < sizeof(buf)-5) {
+    while (n > 0 && k < max) {
         if (isprint(*p)) {
             buf[k] = *p;
             k += 1;
@@ -95,11 +96,10 @@
 
 static void print(const char *tag, al_t *al)
 {
+#if 0
     char *buf;
     size_t n, len;
 
-    return;
-
     n = al_bytes(al);
     buf = (char *)malloc(n);
     if (buf == NULL) abort();
@@ -113,6 +113,7 @@
     printf("\n\n");
 
     free(buf);
+#endif
 }
 
 static void checklen(const char *tag, al_t *al)
@@ -124,7 +125,7 @@
     total = 0;
 
     al_txalloc(al, &tx);
-    al_traverse(al, 0, -1, AL_FORWARD, NULL, tx);
+    al_traverse(al, 0, al_bytes(al), AL_FORWARD, NULL, tx);
     while (al_traverse_next(al, tx, &cur) == AL_OK)
         total += al_chunk_len(cur);
     al_traverse_end(al, tx, 1);

CVSTrac 2.0.1