OSSP CVS Repository

ossp - Check-in [4259]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4259
Date: 2001-Aug-01 14:03:54 (local)
2001-Aug-01 12:03:54 (UTC)
User:simons
Branch:callback-semantic-rewrite
Comment: - Use memcmp() instead of strcmp() because we can't rely on trailing zero bytes.

- Adapted dummy engine to new semantics.

Tickets:
Inspections:
Files:
ossp-pkg/xds/regression-tests/xds-decode.c      1.3.2.1 -> 1.3.2.2     8 inserted, 2 deleted

ossp-pkg/xds/regression-tests/xds-decode.c 1.3.2.1 -> 1.3.2.2

--- xds-decode.c 2001/08/01 11:27:20     1.3.2.1
+++ xds-decode.c 2001/08/01 12:03:54     1.3.2.2
@@ -63,12 +63,18 @@
         printf("args pointer passed to engine is NULL!\n");
         exit(1);
         }
-    if (strncmp(buffer, "Hallo!", 6) != 0)
+    if (buffer_size < 6)
+        {
+        printf("The buffer is too small; can't verify my encoded string.\n");
+        exit(1);
+        }
+    if (memcmp(buffer, "Hallo!", 6) != 0)
         {
         printf("The contents of the decode buffer are not what we expected.\n");
         exit(1);
         }
-    return 6;
+    *used_buffer_size = 6;
+    return XDS_OK;
     }
 
 int main()

CVSTrac 2.0.1