"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/frontend/lexpgn.ll" between
gnuchess-6.2.4.tar.gz and gnuchess-6.2.5.tar.gz

About: GNU Chess is a chess-playing program.

lexpgn.ll  (gnuchess-6.2.4):lexpgn.ll  (gnuchess-6.2.5)
%{ %{
/* lexpgn by David A. Wheeler (http://www.dwheeler.com). /* lexpgn by David A. Wheeler (http://www.dwheeler.com).
GNU Chess frontend GNU Chess frontend
Copyright (C) 2001-2011 Free Software Foundation, Inc. Copyright (C) 2001-2017 Free Software Foundation, Inc.
GNU Chess is based on the two research programs GNU Chess is based on the two research programs
Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft. Cobalt by Chua Kong-Sian and Gazebo by Stuart Cracraft.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
skipping to change at line 98 skipping to change at line 98
char *pgn_othertags; char *pgn_othertags;
char *initial_comments; /* PGN comments before any moves */ char *initial_comments; /* PGN comments before any moves */
char *return_append_str(char *dest, const char *s) { char *return_append_str(char *dest, const char *s) {
/* Append text s to dest, and return new result. */ /* Append text s to dest, and return new result. */
char *newloc; char *newloc;
size_t newlen; size_t newlen;
/* This doesn't have buffer overflow vulnerabilities, because /* This doesn't have buffer overflow vulnerabilities, because
we always allocate for enough space before appending. */ we always allocate for enough space before appending. */
if (!dest) { if (!dest) {
newloc = (char *) malloc(strlen(s))+1; newloc = (char *) malloc(strlen(s)+1);
strcpy(newloc, s); strcpy(newloc, s);
return newloc; return newloc;
} }
newlen = strlen(dest) + strlen(s) + 1; newlen = strlen(dest) + strlen(s) + 1;
newloc = (char *) malloc(newlen); newloc = (char *) malloc(newlen);
strcpy(newloc, dest); strcpy(newloc, dest);
if (!newloc) return dest; /* Can't do it, throw away the data */ if (!newloc) return dest; /* Can't do it, throw away the data */
strcat(newloc, s); strcat(newloc, s);
return newloc; return newloc;
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)