diff options
author | rubidium <rubidium@openttd.org> | 2014-04-23 21:12:09 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-04-23 21:12:09 +0000 |
commit | 5b82822c12e014771dceaf9d909e1c0f3653c5a9 (patch) | |
tree | 1cf02e076eb61eb94d9064c7cb02bbe85ecb9a6c /src/screenshot.cpp | |
parent | ef4c2ce0317ae583e837722b6a41ea44cd83da71 (diff) | |
download | openttd-5b82822c12e014771dceaf9d909e1c0f3653c5a9.tar.xz |
(svn r26486) -Codechange: replace a number of snprintfs with seprintf
Diffstat (limited to 'src/screenshot.cpp')
-rw-r--r-- | src/screenshot.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/screenshot.cpp b/src/screenshot.cpp index 799be36d2..6882e0905 100644 --- a/src/screenshot.cpp +++ b/src/screenshot.cpp @@ -718,12 +718,12 @@ static const char *MakeScreenshotName(const char *default_fn, const char *ext, b /* Add extension to screenshot file */ size_t len = strlen(_screenshot_name); - snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, ".%s", ext); + seprintf(&_screenshot_name[len], lastof(_screenshot_name), ".%s", ext); const char *screenshot_dir = crashlog ? _personal_dir : FiosGetScreenshotDir(); for (uint serial = 1;; serial++) { - if (snprintf(_full_screenshot_name, lengthof(_full_screenshot_name), "%s%s", screenshot_dir, _screenshot_name) >= (int)lengthof(_full_screenshot_name)) { + if (seprintf(_full_screenshot_name, lastof(_full_screenshot_name), "%s%s", screenshot_dir, _screenshot_name) >= (int)lengthof(_full_screenshot_name)) { /* We need more characters than MAX_PATH -> end with error */ _full_screenshot_name[0] = '\0'; break; @@ -731,7 +731,7 @@ static const char *MakeScreenshotName(const char *default_fn, const char *ext, b if (!generate) break; // allow overwriting of non-automatic filenames if (!FileExists(_full_screenshot_name)) break; /* If file exists try another one with same name, but just with a higher index */ - snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, "#%u.%s", serial, ext); + seprintf(&_screenshot_name[len], lastof(_screenshot_name) - len, "#%u.%s", serial, ext); } return _full_screenshot_name; |