bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-glpk] Bug Report


From: Kayi Lee
Subject: [Bug-glpk] Bug Report
Date: Sat, 13 Jul 2002 01:42:51 -0700

insist fails in function make_names() in glpapi1.c  (line 2905)  when the
string length of name is greater than 8.


Error:

.
.
.

glp_write_mps: writing problem data to `MPS'...

Assertion failed: strlen(alias[ij]) <= 8, file source/glpapi1.c, line 2905



Patch:

--- glpapi1.c   Sat Jul 13 01:11:34 2002
+++ glpapi1_new.c       Sat Jul 13 01:31:25 2002
@@ -2880,25 +2880,29 @@
          }
          /* the first try: abc~wxyz */
          memcpy(alias[ij]+0, name+0, 3);
          memcpy(alias[ij]+3, "~", 1);
          memcpy(alias[ij]+4, name+(len-4), 4);
+        memcpy(alias[ij]+8, "\0", 1);
          if (find_by_key(tree, alias[ij]) == NULL) goto fini;
          /* the second try: abcd~xyz */
          memcpy(alias[ij]+0, name+0, 4);
          memcpy(alias[ij]+4, "~", 1);
          memcpy(alias[ij]+5, name+(len-3), 3);
+        memcpy(alias[ij]+8, "\0", 1);
          if (find_by_key(tree, alias[ij]) == NULL) goto fini;
          /* the third try: abcde~yz */
          memcpy(alias[ij]+0, name+0, 5);
          memcpy(alias[ij]+4, "~", 1);
          memcpy(alias[ij]+6, name+(len-2), 2);
+        memcpy(alias[ij]+8, "\0", 1);
          if (find_by_key(tree, alias[ij]) == NULL) goto fini;
          /* the fourth try: abcdef~z */
          memcpy(alias[ij]+0, name+0, 6);
          memcpy(alias[ij]+4, "~", 1);
          memcpy(alias[ij]+7, name+(len-1), 1);
+        memcpy(alias[ij]+8, "\0", 1);
          if (find_by_key(tree, alias[ij]) == NULL) goto fini;
 alas:    /* hmm... nothing came of it :+( */
          strcpy(alias[ij], plain_name(what, ij));
          insist(find_by_key(tree, alias[ij]) == NULL);
 fini:    /* enter the generated name to the symbol table */


Thanks,
Kayi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]