]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/picsmap.c
ncurses 6.2 - patch 20210508
[ncurses.git] / test / picsmap.c
index ecd70fbeb41be87cc1b28291968f17bfef936ceb..f95747f406f34626acd3707c36e7a2310e244645 100644 (file)
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.136 2021/03/20 16:08:22 tom Exp $
+ * $Id: picsmap.c,v 1.139 2021/05/08 15:56:05 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -604,7 +604,6 @@ read_palette(const char *filename)
                    continue;
                }
            }
-           s += strlen(s);
 
            if (tries & 2) {
                int len = (int) strlen(filename);
@@ -990,7 +989,7 @@ parse_xbm(char **data)
 {
     int n;
     int state = 0;
-    char buf[BUFSIZ];
+    char buf[2048];
     int num;
     char ch;
     char *s;
@@ -1015,7 +1014,7 @@ parse_xbm(char **data)
        case 0:
        case 1:
        case 2:
-           if (sscanf(s, "#define %s %d%c", buf, &num, &ch) >= 2) {
+           if (sscanf(s, "#define %1024s %d%c", buf, &num, &ch) >= 2) {
                if ((t = strstr(buf, "_width")) != 0) {
                    state |= 1;
                    result->wide = (short) bytes_of(num);
@@ -1036,7 +1035,7 @@ parse_xbm(char **data)
            }
            break;
        case 3:
-           if (sscanf(s, "static char %[^_ ]_bits[]%c", buf, &ch) >= 1) {
+           if (sscanf(s, "static char %1024[^_ ]_bits[]%c", buf, &ch) >= 1) {
                if (strcmp(result->name, buf)) {
                    goto finish;
                }