From 2a49732159683cd0981d49cce66f9945b83d405b Mon Sep 17 00:00:00 2001
From: mathias <mathias>
Date: Tue, 11 Jan 2005 12:39:01 +0000
Subject: fix for #1099278

---
 src/FbTk/TextureRender.cc | 6 +++---
 src/Resources.cc          | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/FbTk/TextureRender.cc b/src/FbTk/TextureRender.cc
index 5e7520b..0adb8e1 100644
--- a/src/FbTk/TextureRender.cc
+++ b/src/FbTk/TextureRender.cc
@@ -113,7 +113,7 @@ void TextureRender::allocateColorTables() {
 
     if (red == 0) {
         char sbuf[128];
-        sprintf(sbuf, "%d", size);
+        sprintf(sbuf, "%ld", (long int) size);
         throw std::string("TextureRender::TextureRender(): " + 
               std::string(_FBTKTEXT(Error, OutOfMemoryRed, "Out of memory while allocating red buffer.", "")) + string(sbuf));
     }
@@ -122,7 +122,7 @@ void TextureRender::allocateColorTables() {
     green = FB_new_nothrow unsigned char[size];
     if (green == 0) {
         char sbuf[128];
-        sprintf(sbuf, "%d", size);
+        sprintf(sbuf, "%ld", (long int) size);
         throw std::string("TextureRender::TextureRender(): " + 
               std::string(_FBTKTEXT(Error, OutOfMemoryGreen, "Out of memory while allocating green buffer.", ""))+ string(sbuf));
     }
@@ -130,7 +130,7 @@ void TextureRender::allocateColorTables() {
     blue = FB_new_nothrow unsigned char[size];
     if (blue == 0) {
         char sbuf[128];
-        sprintf(sbuf, "%d", size);
+        sprintf(sbuf, "%ld", (long int) size);
         throw std::string("TextureRender::TextureRender(): " +
               std::string(_FBTKTEXT(Error, OutOfMemoryBlue, "Out of memory while allocating blue buffer.", ""))+ string(sbuf));
     }
diff --git a/src/Resources.cc b/src/Resources.cc
index 9fd1dd6..7c7713f 100644
--- a/src/Resources.cc
+++ b/src/Resources.cc
@@ -77,7 +77,7 @@ setFromString(const char *strval) {
 template<>
 void FbTk::Resource<long long>::
 setFromString(const char *strval) {	
-    if (sscanf(strval, "%ul", &m_value) != 1)
+    if (sscanf(strval, "%llu", &m_value) != 1)
         setDefaultValue();
 }
 
@@ -159,7 +159,7 @@ template<>
 string FbTk::Resource<long long>::
 getString() {
     char tmpstr[128];
-    sprintf(tmpstr, "%ul", m_value);
+    sprintf(tmpstr, "%llu", (unsigned long long) m_value);
     return string(tmpstr);
 }
 
-- 
cgit v0.11.2