summaryrefslogtreecommitdiff
path: root/apps/plugins/goban
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/goban')
-rw-r--r--apps/plugins/goban/sgf.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/apps/plugins/goban/sgf.c b/apps/plugins/goban/sgf.c
index 49dd28ff93..49dc617756 100644
--- a/apps/plugins/goban/sgf.c
+++ b/apps/plugins/goban/sgf.c
@@ -1261,6 +1261,13 @@ read_comment_sgf (char *buffer, size_t buffer_size)
1261 return -1; 1261 return -1;
1262 } 1262 }
1263 1263
1264 if (!(read_char_no_whitespace (unhandled_fd) == 'C') ||
1265 !(read_char_no_whitespace (unhandled_fd) == '['))
1266 {
1267 DEBUGF ("comment prop points to incorrect place in unhandled_fd!!\n");
1268 return -1;
1269 }
1270
1264 /* make output a string, the lazy way */ 1271 /* make output a string, the lazy way */
1265 rb->memset (buffer, 0, buffer_size); 1272 rb->memset (buffer, 0, buffer_size);
1266 ++bytes_read; 1273 ++bytes_read;
@@ -1351,7 +1358,16 @@ write_comment_sgf (char *string)
1351 1358
1352 start_of_write_wcs: 1359 start_of_write_wcs:
1353 1360
1354 if (!overwriting) 1361 if (overwriting)
1362 {
1363 if (!(read_char_no_whitespace (unhandled_fd) == 'C') ||
1364 !(read_char_no_whitespace (unhandled_fd) == '['))
1365 {
1366 DEBUGF ("non-comment while overwriting!!\n");
1367 return -1;
1368 }
1369 }
1370 else
1355 { 1371 {
1356 start_of_comment = rb->lseek (unhandled_fd, 0, SEEK_END); 1372 start_of_comment = rb->lseek (unhandled_fd, 0, SEEK_END);
1357 1373