You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-lang/gdl/files/0.9.3-sstream.patch

43 lines
891 B

--- 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();
}