summaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-08-20 01:43:20 +0200
committerDennis kasprzyk <onestone@opencompositing.org>2008-08-20 01:43:20 +0200
commit94de9e6dcc21bf9cd747138da2ba7029e7045716 (patch)
treed757557ff77ef9052fa5dee4eea626bf955c167d /src/string.cpp
parent79d78d3f60e683411a075fe44fe4ab862d0fadc6 (diff)
downloadunity-window-decorator-94de9e6dcc21bf9cd747138da2ba7029e7045716.tar.gz
unity-window-decorator-94de9e6dcc21bf9cd747138da2ba7029e7045716.tar.bz2
Port of CompOption and CompAction to C++.
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/string.cpp b/src/string.cpp
index fdf71b3..0276cbd 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -18,7 +18,7 @@ CompString compPrintf (const char *format, va_list ap)
unsigned int size = strlen (format) + 1;
int n;
char *str;
-
+
if (!format)
return CompString ("");
@@ -44,13 +44,15 @@ CompString compPrintf (const char *format, va_list ap)
else /* glibc 2.0 */
size++; /* one more than the old size */
- delete str;
+ delete [] str;
str = new char[size];
- if (str)
+ if (!str)
{
return CompString ("");
}
}
- return CompString ("");
+ CompString rv(str);
+ delete [] str;
+ return rv;
}