X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Frawdsp.c;h=e0a9857ec2f9a6d35a8e41da79c5c533a4a9bebd;hb=7b9775370a639e7a26b5313d3d3b877864635562;hp=b73bd0abb79cfe627d5c62fe2ba7d85e6c55537f;hpb=949b99b045640dc69303dab9d34c3522baa19caf;p=gnushogi.git diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index b73bd0a..e0a9857 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -794,10 +794,16 @@ Raw_SelectLevel(char *sx) void -Raw_ChangeSearchDepth(void) +Raw_ChangeSearchDepth(char *sx) { - printf("depth = "); - scanf("%hd", &MaxSearchDepth); + char buf[80+1]; + strncpy(buf, sx, 80); buf[80] = '\0'; + /* if line empty, ask for input */ + if (!buf[0]) { + printf("depth = "); + fgets(buf, 80+1, stdin); + } + sscanf(buf, "%hd", &MaxSearchDepth); TCflag = !(MaxSearchDepth > 0); }