cdriso: use correct buffer in .toc check
authornotaz <notasas@gmail.com>
Sun, 26 May 2013 13:25:24 +0000 (16:25 +0300)
committernotaz <notasas@gmail.com>
Sun, 26 May 2013 13:25:24 +0000 (16:25 +0300)
libpcsxcore/cdriso.c

index 9ca4172..f7359ce 100644 (file)
@@ -329,8 +329,8 @@ static int parsetoc(const char *isofile) {
                }
                // check if it's really a TOC named as a .cue
                fgets(linebuf, sizeof(linebuf), fi);
-               token = strtok(tmp, " ");
-               if (strncmp(token, "CD", 2) != 0 && strcmp(token, "CATALOG") != 0) {
+               token = strtok(linebuf, " ");
+               if (token && strncmp(token, "CD", 2) != 0 && strcmp(token, "CATALOG") != 0) {
                        fclose(fi);
                        return -1;
                }