(svn r14542) -Codechange: replace some sprintf with s[en]printf to make sure they will not overflow their buffers.

This commit is contained in:
rubidium
2008-10-28 16:04:41 +00:00
parent 56d0990d62
commit db1fd2e085
4 changed files with 29 additions and 25 deletions

View File

@@ -95,9 +95,9 @@ char *FiosBrowseTo(const FiosItem *item)
switch (item->type) {
case FIOS_TYPE_DRIVE:
#if defined(WINCE)
sprintf(path, PATHSEP "");
snprintf(path, MAX_PATH, PATHSEP "");
#elif defined(WIN32) || defined(__OS2__)
sprintf(path, "%c:" PATHSEP, item->title[0]);
snprintf(path, MAX_PATH, "%c:" PATHSEP, item->title[0]);
#endif
/* Fallthrough */
case FIOS_TYPE_INVALID:
@@ -124,7 +124,7 @@ char *FiosBrowseTo(const FiosItem *item)
break;
case FIOS_TYPE_DIRECT:
sprintf(path, "%s", item->name);
snprintf(path, MAX_PATH, "%s", item->name);
break;
case FIOS_TYPE_FILE: