about summary refs log tree commit diff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 5184c1136c..8922edcd71 100644
--- a/elf/dl-minimal.c
+++ b/elf/dl-minimal.c
@@ -252,6 +252,8 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
 	  || (result == ULONG_MAX / 10 && digval > ULONG_MAX % 10))
 	{
 	  errno = ERANGE;
+	  if (endptr != NULL)
+	    *endptr = (char *) nptr;
 	  return ULONG_MAX;
 	}
       result *= base;
@@ -259,5 +261,7 @@ __strtoul_internal (const char *nptr, char **endptr, int base, int group)
       ++nptr;
     }
 
+  if (endptr != NULL)
+    *endptr = (char *) nptr;
   return result * sign;
 }