42 lines
891 B
Diff
42 lines
891 B
Diff
--- src/magick_cl.cpp.orig 2013-01-02 13:39:02.387184167 -0800
|
|
+++ src/magick_cl.cpp 2013-01-02 13:40:14.876543262 -0800
|
|
@@ -30,6 +30,7 @@
|
|
#include <string>
|
|
#include <fstream>
|
|
#include <memory>
|
|
+#include <sstream>
|
|
//#include <Magick++.h>
|
|
|
|
#include "datatypes.hpp"
|
|
@@ -57,25 +58,17 @@
|
|
|
|
string GDLutos(unsigned int i)
|
|
{
|
|
- int mema=3;
|
|
- char *n=new char(mema);
|
|
- while (snprintf(n, sizeof n, "%u", i) >= sizeof n)
|
|
- { delete n;mema++; n=new char(mema); }
|
|
- string s=n;
|
|
- delete n;
|
|
- return s;
|
|
+ istringstream s;
|
|
+ s >> i;
|
|
+ return s.str();
|
|
}
|
|
|
|
|
|
string GDLitos(int i)
|
|
{
|
|
- int mema=3;
|
|
- char *n=new char(mema);
|
|
- while (snprintf(n, sizeof n, "%d", i) >= sizeof n)
|
|
- { delete n;mema++; n=new char(mema); }
|
|
- string s=n;
|
|
- delete n;
|
|
- return s;
|
|
+ istringstream s;
|
|
+ s >> i;
|
|
+ return s.str();
|
|
}
|
|
|
|
|