]> git.lizzy.rs Git - plan9front.git/commitdiff
gb*: reverse savegame field polarity
authorqwx <devnull@localhost>
Sat, 31 Mar 2018 09:38:09 +0000 (11:38 +0200)
committerqwx <devnull@localhost>
Sat, 31 Mar 2018 09:38:09 +0000 (11:38 +0200)
sys/src/games/gb/gb.c
sys/src/games/gba/gba.c

index d6762b182fad12a62dfd0308428a21e418a15729..374af931af30670bb85707e46e62a0dcea5865cb 100644 (file)
@@ -99,7 +99,7 @@ loadsave(char *file)
 
        buf = emalloc(strlen(file) + 4);
        strcpy(buf, file);
-       p = strchr(buf, '.');
+       p = strrchr(buf, '.');
        if(p == nil)
                p = buf + strlen(buf);
        strcpy(p, ".sav");
index 8457b1e6fc36858b50dec6b695b6a55ca35e47f5..5a53b68b3a96d5f87af0a9b9a12e2b9851f8791c 100644 (file)
@@ -145,7 +145,7 @@ loadsave(char *file)
        
        buf = emalloc(strlen(file) + 4);
        strcpy(buf, file);
-       p = strchr(buf, '.');
+       p = strrchr(buf, '.');
        if(p == nil)
                p = buf + strlen(buf);
        strcpy(p, ".sav");