[xiph-cvs] cvs commit: vorbis-tools/ogg123 options.c

Kenneth C. Arnold kcarnold at xiph.org
Thu Aug 30 16:32:10 PDT 2001



kcarnold    01/08/30 16:32:09

  Modified:    ogg123   Tag: kcarnold_work options.c
  Log:
  Me stupid. Caught this while compiling optimized build. Very surprised
  it didn't segfault here before.

Revision  Changes    Path
No                   revision

No                   revision

1.1.2.6   +5 -4      vorbis-tools/ogg123/Attic/options.c

Index: options.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogg123/Attic/options.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- options.c	2001/08/30 02:06:24	1.1.2.5
+++ options.c	2001/08/30 23:32:09	1.1.2.6
@@ -11,7 +11,7 @@
  *                                                                  *
  ********************************************************************
 
- last mod: $Id: options.c,v 1.1.2.5 2001/08/30 02:06:24 kcarnold Exp $
+ last mod: $Id: options.c,v 1.1.2.6 2001/08/30 23:32:09 kcarnold Exp $
 
  ********************************************************************/
 
@@ -128,7 +128,7 @@
   while (opt->name) {
     if (!strcasecmp (opt->name, line)) {
       long tmpl;
-      char **endptr;
+      char *endptr;
 
       /* found the key. now set the value. */
       switch (opt->type) {
@@ -154,9 +154,9 @@
       case opt_type_int:
         if (!value || *value == '\0')
           return parse_badvalue;
-	tmpl = strtol (value, endptr, 0);
+	tmpl = strtol (value, &endptr, 0);
         if (((tmpl == LONG_MIN || tmpl == LONG_MAX) && errno == ERANGE)
-	    || (**endptr != '\0'))
+	    || (*endptr != '\0'))
           return parse_badvalue;
         opt->found++;
         *(long int *) opt->ptr = tmpl;
@@ -243,6 +243,7 @@
         line[readoffset] = (unsigned char) thischar;
       readoffset++;
     }
+    fprintf (stderr, "Read line: %s\n", line);
     pcode = ParseLine (opts, line);
     if (pcode != parse_ok)
       if (!errfunc (arg, pcode, lineno, filename, line)) {

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list