sgwdynspeed: add asserts to readUL
authorFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 6 Jun 2012 15:03:08 +0000 (17:03 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 7 Jun 2012 22:29:39 +0000 (00:29 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/sgwdynspeed/src/speedFile.c

index 1ebc0fa..b6ba831 100644 (file)
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <stdio.h>
+#include <assert.h>
 
 #define SPEED_UPLINK_NAME   "upstream"
 #define SPEED_DOWNLINK_NAME "downstream"
@@ -65,6 +66,10 @@ static bool readUL(const char * valueName, const char * value, unsigned long * v
        char * endPtr = NULL;
        unsigned long valueNew;
 
+       assert(valueName != NULL);
+       assert(value != NULL);
+       assert(valueNumber != NULL);
+
        errno = 0;
        valueNew = strtoul(value, &endPtr, 10);