Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!datapg!com50!com2serv.c2s.mn.org!markc From: markc@com2serv.c2s.mn.org (Mark H. Colburn) Newsgroups: comp.lang.c Subject: Strtol and strtoul... Message-ID: <3233@com50.C2S.MN.ORG> Date: 15 Dec 89 05:39:24 GMT Sender: nntp@com50.C2S.MN.ORG Reply-To: mark@jhereg.minnetech.mn.org (Mark H. Colburn) Organization: Open Systems Architects, Inc., Mpls, MN Lines: 18 I have a question about the wording of the descriptions for the strtol and strtoul library calls in the ANSI draft standard (I have the October 31, 1988 version): where should endptr point to if an error occurs? For example, given the following code: unsigned long foo; char *ptr; foo = strtoul("-12345", &ptr, 0); where would ptr point to? The call should return ULONG_MAX with errno set to ERANGE, but does *ptr = '-' or '\0' (end of string) or is it indeterminate? It looks as if it should point to '\0', but... Mark H. Colburn mark@minnetech.mn.org Open Systems Architects, Inc.