From 633b15caf3f616f7778ca153573097fcb7fdfad0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 28 Oct 2008 16:04:41 +0000 Subject: (svn r14542) -Codechange: replace some sprintf with s[en]printf to make sure they will not overflow their buffers. --- src/fios.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/fios.cpp') diff --git a/src/fios.cpp b/src/fios.cpp index 116179228..aa2ecf236 100644 --- a/src/fios.cpp +++ b/src/fios.cpp @@ -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: -- cgit v1.2.3-54-g00ecf