X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Frawdsp.c;h=bf3f4c1cd1fa58ebe2f282a30d9bfedabf2853f5;hb=168ca19e0f412a537388cea5c4d8fa0a39f082a5;hp=8a6ec660559f7fe07ab0b5f920eaa4de1c32cecc;hpb=8b99a4438f25882af1613c98911b984e2a49013e;p=gnushogi.git diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index 8a6ec66..bf3f4c1 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -162,10 +162,17 @@ int Raw_GetString(char* sx) { int eof = 0; + char *nl; sx[0] = '\0'; while(!eof && !sx[0]) eof = (fgets(sx, 80, stdin) == NULL); + + /* remove any trailing newline */ + nl = strchr(sx, '\n'); + if (nl) + nl[0] = '\0'; + return eof; } @@ -698,6 +705,7 @@ Raw_GiveHint(void) void Raw_SelectLevel(char *sx) { + /* FIXME: NO_SQUARES is nonsense here */ char T[NO_SQUARES + 1], *p; strncpy(T, sx, NO_SQUARES);