Module Name:    src
Committed By:   christos
Date:           Wed May 20 22:03:29 UTC 2009

Modified Files:
        src/common/lib/libc/stdlib: _strtol.h

Log Message:
Set endptr if the base is not supported. The opengroup spec does not special
case this condition. Note: glibc has the same problem.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/stdlib/_strtol.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/stdlib/_strtol.h
diff -u src/common/lib/libc/stdlib/_strtol.h:1.1 src/common/lib/libc/stdlib/_strtol.h:1.2
--- src/common/lib/libc/stdlib/_strtol.h:1.1	Wed Aug 20 08:42:26 2008
+++ src/common/lib/libc/stdlib/_strtol.h	Wed May 20 18:03:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: _strtol.h,v 1.1 2008/08/20 12:42:26 joerg Exp $ */
+/* $NetBSD: _strtol.h,v 1.2 2009/05/20 22:03:29 christos Exp $ */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -57,7 +57,10 @@
 	if (base && (base < 2 || base > 36)) {
 #if !defined(_KERNEL) && !defined(_STANDALONE)
 		errno = EINVAL;
-		return(0);
+		if (endptr != NULL)
+			/* LINTED interface specification */
+			*endptr = __UNCONST(nptr);
+		return 0;
 #else
 		panic("%s: invalid base %d", __func__, base);
 #endif

Reply via email to