summaryrefslogtreecommitdiff
path: root/lib/String.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/String.cc')
-rw-r--r--lib/String.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/String.cc b/lib/String.cc
index 4d7b0ff..a2c8829 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -130,8 +130,6 @@ const char * String::set(const char * s, ...) {
return t;
}
-/* This causes a warning: cannot pass objects of type `const String' through `...'
- but it is not really a problem. */
va_start(ap, s);
#ifdef HAVE_VSNPRINTF
vsnprintf(t, BUFSIZ, s, ap);
@@ -145,14 +143,14 @@ const char * String::set(const char * s, ...) {
return t;
}
-const char * String::set(const String & s, ...) {
+const char * String::set(const ugly_string & s, ...) {
va_list ap;
va_start(ap, s);
#ifdef HAVE_VSNPRINTF
- vsnprintf(t, BUFSIZ, s.str, ap);
+ vsnprintf(t, BUFSIZ, s.p, ap);
#else
- vsprintf(t, s.str, ap);
+ vsprintf(t, s.p, ap);
#endif
free(str);
str = Base::strdup(t);
@@ -416,6 +414,12 @@ String operator+(const char * a, const String & b) {
return String(a) + b;
}
+String::operator ugly_string() const {
+ ugly_string r;
+ r.p = str;
+ return r;
+}
+
String & String::toupper() {
for (int i = 0; i < strlen(); i++) {
str[i] = ::toupper(str[i]);