]> git.sesse.net Git - ffmpeg/blobdiff - compat/getopt.c
lavu: Add av_gettime_relative
[ffmpeg] / compat / getopt.c
index 3a873b27eee4a4d7fcb96b28b11bb7b82b5e1a42..b7adf60e2fdc91c274d368e3147a46c9343a0f22 100644 (file)
  * in the public domain.
  */
 
-#define EOF (-1)
+#include <stdio.h>
+#include <string.h>
 
 static int opterr = 1;
 static int optind = 1;
 static int optopt;
 static char *optarg;
 
-#undef fprintf
-
 static int getopt(int argc, char *argv[], char *opts)
 {
     static int sp = 1;
@@ -54,7 +53,7 @@ static int getopt(int argc, char *argv[], char *opts)
             return EOF;
         }
     optopt = c = argv[optind][sp];
-    if (c == ':' || (cp = strchr(opts, c)) == NULL) {
+    if (c == ':' || !(cp = strchr(opts, c))) {
         fprintf(stderr, ": illegal option -- %c\n", c);
         if (argv[optind][++sp] == '\0') {
             optind++;