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

Michael Smith msmith at xiph.org
Tue Jan 29 02:37:10 PST 2002



msmith      02/01/29 02:37:09

  Modified:    vcut     vcut.c
  Log:
  Do sscanf() differently on win32, because of gratuitous incompatibilities.

Revision  Changes    Path
1.6       +10 -2     vorbis-tools/vcut/vcut.c

Index: vcut.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/vcut/vcut.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- vcut.c	2002/01/26 11:06:42	1.5
+++ vcut.c	2002/01/29 10:37:08	1.6
@@ -7,7 +7,7 @@
  * Simple application to cut an ogg at a specified frame, and produce two
  * output files.
  *
- * last modified: $Id: vcut.c,v 1.5 2002/01/26 11:06:42 segher Exp $
+ * last modified: $Id: vcut.c,v 1.6 2002/01/29 10:37:08 msmith Exp $
  */
 
 #include <stdio.h>
@@ -23,6 +23,11 @@
 #include <locale.h>
 #include "i18n.h"
 
+#ifdef _WIN32
+#define FORMAT_INT64 "%I64d"
+#else
+#define FORMAT_INT64 "%Ld"
+#endif
 
 static vcut_packet *save_packet(ogg_packet *packet)
 {
@@ -471,7 +476,10 @@
                 exit(1);
         }
 
-	sscanf(argv[4], "%Ld", &cutpoint);
+	if(sscanf(argv[4], FORMAT_INT64, &cutpoint) != 1) {
+        fprintf(stderr, _("Couldn't parse cutpoint \"%s\"\n"), argv[4]);
+        exit(1);
+    }
 
         fprintf(stderr, _("Processing: Cutting at %lld\n"), cutpoint);
 

<p><p><p>--- >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