summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/HttpServ.cc2
-rw-r--r--lib/String.cc22
2 files changed, 22 insertions, 2 deletions
diff --git a/lib/HttpServ.cc b/lib/HttpServ.cc
index 004567b..2c79de7 100644
--- a/lib/HttpServ.cc
+++ b/lib/HttpServ.cc
@@ -276,7 +276,7 @@ bool ProcessRequest::ParseUri(String & file, String & domain, String & gvars, Ha
ssize_t sppos;
*s >> t;
- std::cerr << "Read Request (1): " << t << std::endl;
+ std::cerr << "Read Request (1): " << t << std::endl;
int IPos = t.strchr('?');
diff --git a/lib/String.cc b/lib/String.cc
index a2c8829..bcea5d2 100644
--- a/lib/String.cc
+++ b/lib/String.cc
@@ -159,6 +159,26 @@ const char * String::set(const ugly_string & s, ...) {
return t;
}
+int String::scanf(const char * s, ...) {
+ va_list ap;
+ int t;
+
+ va_start(ap, s);
+ t = vsscanf(str, s, ap);
+ va_end(ap);
+ return t;
+}
+
+int String::scanf(const ugly_string & s, ...) {
+ va_list ap;
+ int t;
+
+ va_start(ap, s);
+ t = vsscanf(str, s.p, ap);
+ va_end(ap);
+ return t;
+}
+
const char * String::to_charp(size_t from, ssize_t to) const {
if (to < 0) {
strncpy(t, &(str[from]), BUFSIZ);
@@ -189,7 +209,7 @@ String String::extract(size_t from, ssize_t to) const {
}
char * String::strdup(size_t from, ssize_t to) const {
- return Base::strdup(to_charp(from, to));
+ return Base::strdup(extract(from, to));
}
int String::to_int(void) const {