* s390-mkopc.c (main): Exit with error 1 if sscanf fails
[deliverable/binutils-gdb.git] / opcodes / s390-mkopc.c
index 84981ccebf4a8d65022edd69cec951bb46b659ef..b3f13ab5368590a559b705a4814bf8e951122d1b 100644 (file)
@@ -335,7 +335,7 @@ main (void)
       char  opcode[16];
       char  mnemonic[16];
       char  format[16];
-      char  description[64];
+      char  description[80];
       char  cpu_string[16];
       char  modes_string[16];
       int   min_cpu;
@@ -345,7 +345,7 @@ main (void)
       if (currentLine[0] == '#')
         continue;
       memset (opcode, 0, 8);
-      if (sscanf (currentLine, "%15s %15s %15s \"%[^\"]\" %15s %15s",
+      if (sscanf (currentLine, "%15s %15s %15s \"%79[^\"]\" %15s %15s",
                  opcode, mnemonic, format, description,
                  cpu_string, modes_string) == 6)
        {
@@ -393,7 +393,10 @@ main (void)
          insertExpandedMnemonic (opcode, mnemonic, format, min_cpu, mode_bits);
        }
       else
-        fprintf (stderr, "Couldn't scan line %s\n", currentLine);
+       {
+         fprintf (stderr, "Couldn't scan line %s\n", currentLine);
+         exit (1);
+       }
     }
 
   dumpTable ();
This page took 0.024435 seconds and 4 git commands to generate.