[Pkg-shadow-commits] r2493 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun Mar 8 20:21:24 UTC 2009


Author: nekral-guest
Date: 2009-03-08 20:21:24 +0000 (Sun, 08 Mar 2009)
New Revision: 2493

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/getlong.c
Log:
	* libmisc/getlong.c: Make sure the getlong argument is not empty.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-03-07 16:32:11 UTC (rev 2492)
+++ upstream/trunk/ChangeLog	2009-03-08 20:21:24 UTC (rev 2493)
@@ -1,5 +1,9 @@
 2009-03-07  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* libmisc/getlong.c: Make sure the getlong argument is not empty.
+
+2009-03-07  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* contrib/adduser-old.c, contrib/adduser.c: Do not use the target
 	of snprintf in one of the format's parameters.
 

Modified: upstream/trunk/libmisc/getlong.c
===================================================================
--- upstream/trunk/libmisc/getlong.c	2009-03-07 16:32:11 UTC (rev 2492)
+++ upstream/trunk/libmisc/getlong.c	2009-03-08 20:21:24 UTC (rev 2493)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2009, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,14 +34,14 @@
 #include "prototypes.h"
 #include "defines.h"
 
-int getlong(const char *numstr, long int *result)
+int getlong (const char *numstr, long int *result)
 {
 	long val;
 	char *endptr;
 
 	errno = 0;
 	val = strtol (numstr, &endptr, 10);
-	if (('\0' != *endptr) || (ERANGE == errno)) {
+	if (('\0' == numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
 		return 0;
 	}
 




More information about the Pkg-shadow-commits mailing list