Patch by starsseed from ticket #7341: Use correct format strings
in sprintf() invokations, specifically to avoid reading more bytes than are contained in the passed arguments. Thanks! Small cleanups of the touced code by myself included. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40876 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -549,11 +549,11 @@ MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile,
|
||||
break;
|
||||
}
|
||||
completePercent = (float)(i - start) / (float)(end - start) * 100;
|
||||
currPercent = (int16)floor(completePercent);
|
||||
currPercent = (int32)completePercent;
|
||||
if (currPercent > lastPercent) {
|
||||
lastPercent = currPercent;
|
||||
snprintf(status.LockBuffer(128), 128,
|
||||
B_TRANSLATE("Writing video track: %Ld %% complete"),
|
||||
B_TRANSLATE("Writing video track: %ld%% complete"),
|
||||
currPercent);
|
||||
status.UnlockBuffer();
|
||||
SetStatusMessage(status.String());
|
||||
@@ -607,11 +607,11 @@ MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile,
|
||||
break;
|
||||
}
|
||||
completePercent = (float)(i - start) / (float)(end - start) * 100;
|
||||
currPercent = (int16)floor(completePercent);
|
||||
currPercent = (int32)completePercent;
|
||||
if (currPercent > lastPercent) {
|
||||
lastPercent = currPercent;
|
||||
snprintf(status.LockBuffer(128), 128,
|
||||
B_TRANSLATE("Writing audio track: %Ld %% complete"),
|
||||
B_TRANSLATE("Writing audio track: %ld%% complete"),
|
||||
currPercent);
|
||||
status.UnlockBuffer();
|
||||
SetStatusMessage(status.String());
|
||||
|
||||
@@ -70,7 +70,7 @@ MediaFileInfo::LoadInfo(BMediaFile* file)
|
||||
|
||||
BString details;
|
||||
snprintf(details.LockBuffer(256), 256,
|
||||
B_TRANSLATE_COMMENT("%Ld x %Ld, %Ld fps / %Ld frames",
|
||||
B_TRANSLATE_COMMENT("%u x %u, %.2ffps / %Ld frames",
|
||||
"Width x Height, fps / frames"),
|
||||
format.Width(), format.Height(),
|
||||
rvf->field_rate / rvf->interlace, videoFrames);
|
||||
|
||||
Reference in New Issue
Block a user