/[chess]/chess/src/lexpgn.l
ViewVC logotype

Diff of /chess/src/lexpgn.l

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by srw, Thu Jun 19 20:59:33 2003 UTC revision 1.4 by srw, Thu Jun 19 21:04:11 2003 UTC
# Line 74  char *return_append_str(char *dest, cons Line 74  char *return_append_str(char *dest, cons
74          /* This doesn't have buffer overflow vulnerabilities, because          /* This doesn't have buffer overflow vulnerabilities, because
75             we always allocate for enough space before appending. */             we always allocate for enough space before appending. */
76          if (!dest) {          if (!dest) {
77                  newloc = malloc(strlen(s))+1;                  newloc = (char *) malloc(strlen(s))+1;
78                  strcpy(newloc, s);                  strcpy(newloc, s);
79                  return newloc;                  return newloc;
80          }          }
81          newlen = strlen(dest) + strlen(s) + 1;          newlen = strlen(dest) + strlen(s) + 1;
82          /* newloc = realloc(dest, newlen); */          newloc = (char *) malloc(newlen);
         newloc = malloc(newlen);  
83          strcpy(newloc, dest);          strcpy(newloc, dest);
84          if (!newloc) return dest; /* Can't do it, throw away the data */          if (!newloc) return dest; /* Can't do it, throw away the data */
85          strcat(newloc, s);          strcat(newloc, s);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26