]> thyrsus.com Git - cstrings.git/commitdiff
ANSI/POSIX conformance.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 15 Nov 1993 18:12:48 +0000 (18:12 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 15 Nov 1993 18:12:48 +0000 (18:12 +0000)
cstrings.l

index f40c3883c5b157a8759f0b636f598e77547adecd..e3bd1fce934ba0db298b3c5fac1221134330e83c 100644 (file)
@@ -4,9 +4,10 @@
  *
  * by Eric S. Raymond <esr@snark.thyrsus.com>, July 10 1990
  *
- * Note: this code will not run unaltered on Berkeley UNIXes that don't have
- * a System V compatibility suite. If this bothers you, get a real UNIX.
+ * version 2.0, November 15 1993 -- strict ANSI/POSIX conformance.
  */
+#define _POSIX_SOURCE
+
 #include <unistd.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -29,7 +30,7 @@ static FILE   *listfp;
 
 /*
  * The VIS class is intended to include all printables except the string quote.
- * EBCDIC sites can eat flaming death, thank you. Have a nice day.
+ * EBCDIC sites can eat flaming death, thank you.  Have a nice day.
  */
 %}
 VIS                    [!#-~   ]
@@ -174,7 +175,7 @@ char        *str;
      * is an interesting question in design
      * philosophy...
      */
-    return(minlength && (strlen(str) - 2 < minlength));
+    return(minlength && ((int)strlen(str) - 2 < minlength));
 }
 
 void cstrfilt(ifp, ofp)