Replace snprintf by UTIL_Format.

This commit is contained in:
Arkshine 2014-08-07 00:51:01 +02:00
parent 8d2770f2f2
commit 6da2078067

View File

@ -137,7 +137,7 @@ SMCError TextParsers::ParseSMCFile(const char *file,
states->col = 0; states->col = 0;
} }
/*libsys->GetPlatformError(error, sizeof(error));*/ /*libsys->GetPlatformError(error, sizeof(error));*/
snprintf(buffer, maxsize, "File could not be opened: %s", error); UTIL_Format(buffer, maxsize, "File could not be opened: %s", error);
return SMCError_StreamOpen; return SMCError_StreamOpen;
} }
@ -146,7 +146,7 @@ SMCError TextParsers::ParseSMCFile(const char *file,
fclose(fp); fclose(fp);
errstr = GetSMCErrorString(result); errstr = GetSMCErrorString(result);
snprintf(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); UTIL_Format(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error");
return result; return result;
} }
@ -197,7 +197,7 @@ SMCError TextParsers::ParseSMCStream(const char *stream,
result = ParseStream_SMC(&rs, RawStreamReader, smc_listener, states); result = ParseStream_SMC(&rs, RawStreamReader, smc_listener, states);
const char *errstr = GetSMCErrorString(result); const char *errstr = GetSMCErrorString(result);
snprintf(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); UTIL_Format(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error");
return result; return result;
} }