Unverified Commit 7dbb70d6 authored by Kurtis Dinelle's avatar Kurtis Dinelle Committed by GitHub
Browse files

Merge pull request #6 from phcoder/snprintf

Replace sprintf with snprintf
parents 0a1ffc3d 325a7a01
......@@ -179,9 +179,9 @@ bool chip8_load_rom(CHIP8 *chip8, char *filename)
fclose(rom);
sprintf(chip8->ROM_path, "%s", filename);
sprintf(chip8->UF_path, "%s.uf", filename);
sprintf(chip8->DMP_path, "%s.dmp", filename);
snprintf(chip8->ROM_path, sizeof(chip8->ROM_path) - 1, "%s", filename);
snprintf(chip8->UF_path, sizeof(chip8->UF_path) - 1, "%s.uf", filename);
snprintf(chip8->DMP_path, sizeof(chip8->DMP_path) - 1, "%s.dmp", filename);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment