> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 11:13:28 up 7 days, 11:13, 1 user, load average: 0.32, 0.15, 0.10
This commit is contained in:
@ -56,11 +56,11 @@ void NDL_OpenCanvas(int *w, int *h) {
|
||||
const char* pos = buf;
|
||||
fread(buf, 1, sizeof(buf), fp);
|
||||
int life = 2;
|
||||
while (sscanf(pos, "%[^:]:%d\n", name, &num) == 2 && life) {
|
||||
while (sscanf(pos, "%[^:]:%d\n", name, &num) == 2 && life--) {
|
||||
pos = strchr(pos, '\n');
|
||||
if (pos == NULL) break;
|
||||
if (strcmp(name, "WIDTH") == 0) { dev_w = num; life--; }
|
||||
if (strcmp(name, "HEIGHT") == 0) { dev_h = num; life--; }
|
||||
if (strcmp(name, "WIDTH") == 0) { dev_w = num; }
|
||||
if (strcmp(name, "HEIGHT") == 0) { dev_h = num; }
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
|
Reference in New Issue
Block a user