Browse Source

Various string/printf fixes.

Darryl Pogue 14 years ago
parent
commit
8a6117358b
  1. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp
  2. 2
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  3. 4
      Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp
  4. 2
      Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp

@ -428,7 +428,7 @@ static bool showBounds = false;
float y = sH * fControls[ i ]->fBoundsPoints[ j ].fY;
plDebugText::Instance().DrawRect( (UInt16)(x - 2), (UInt16)(y - 2), (UInt16)(x + 2), (UInt16)(y + 2), color );
char str[ 16 ];
itoa( j, str, 10 );
snprintf(str, 16, "%d", j);
plDebugText::Instance().DrawString( (UInt16)(x + 8), (UInt16)(y - 8), str, color );
}
}

2
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -32,6 +32,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
//////////////////////////////////////////////////////////////////////////////
#include <wchar.h>
#include "pfJournalBook.h"
#include "hsUtils.h"
#include "hsStlUtils.h"

4
Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp

@ -274,7 +274,7 @@ PyObject *EnumValue_oct(EnumValue *v)
if (x == 0)
strcpy(buf, "0");
else
_snprintf(buf, sizeof(buf), "0%lo", x);
snprintf(buf, sizeof(buf), "0%lo", x);
return PyString_FromString(buf);
}
@ -287,7 +287,7 @@ PyObject *EnumValue_hex(EnumValue *v)
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
_snprintf(buf, sizeof(buf), "0x%lx", x);
snprintf(buf, sizeof(buf), "0x%lx", x);
return PyString_FromString(buf);
}

2
Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp

@ -234,7 +234,7 @@ class pfColorListElement : public pfGUIListText
{
size_t length = wcslen( fString1 ) + wcslen( fString2 ) + 3;
thestring = TRACKED_NEW wchar_t[ length ];
swprintf( thestring, length, L"%s %s", fString1, fString2 );
snwprintf( thestring, length, L"%s %s", fString1, fString2 );
wemade_string = true;
}
else if (fString1)

Loading…
Cancel
Save