delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/08/03/16:28:14

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX19BRC8LJrlBGMCeQVq9oiM222+LhNe3UTurP+WcSp
zfPBnFZy5Bbuix
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: Fixing signedness issue in strtol and strtoll.
Date: Fri, 3 Aug 2007 22:32:15 +0200
User-Agent: KMail/1.9.5
MIME-Version: 1.0
Message-Id: <200708032232.16193.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
Reply-To: djgpp-workers AT delorie DOT com

Small patch to fix signedness issue in strtol and strtoll.

Regards,
Juan M. Guerrero




diff -aprNU3 djgpp.orig/src/libc/ansi/stdlib/strtol.c djgpp/src/libc/ansi/stdlib/strtol.c
--- djgpp.orig/src/libc/ansi/stdlib/strtol.c	2002-10-17 23:00:24 +0000
+++ djgpp/src/libc/ansi/stdlib/strtol.c	2007-08-03 20:01:16 +0000
@@ -88,6 +88,6 @@ strtol(const char *nptr, char **endptr, 
   else if (neg)
     acc = -acc;
   if (endptr != 0)
-    *endptr = any ? unconst(s, char *) - 1 : unconst(nptr, char *);
+    *endptr = any ? unconst((const char *) s, char *) - 1 : unconst(nptr, char *);
   return acc;
 }
diff -aprNU3 djgpp.orig/src/libc/ansi/stdlib/strtoll.c djgpp/src/libc/ansi/stdlib/strtoll.c
--- djgpp.orig/src/libc/ansi/stdlib/strtoll.c	2002-11-30 09:46:42 +0000
+++ djgpp/src/libc/ansi/stdlib/strtoll.c	2007-08-03 20:01:16 +0000
@@ -77,6 +77,6 @@ strtoll(const char *nptr, char **endptr,
   else if (neg)
     acc = -acc;
   if (endptr != 0)
-    *endptr = any ? unconst(s, char *) - 1 : unconst(nptr, char *);
+    *endptr = any ? unconst((const char *) s, char *) - 1 : unconst(nptr, char *);
   return acc;
 }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019