Revamp of the Halibut error handling mechanism.
[sgt/halibut] / ustring.c
index 3d18a4f..3be5511 100644 (file)
--- a/ustring.c
+++ b/ustring.c
@@ -340,7 +340,7 @@ int utoi(wchar_t const *s) {
        s++;
     }
 
-    return n;
+    return n * sign;
 }
 
 double utof(wchar_t const *s)
@@ -480,7 +480,7 @@ int charset_from_ustr(filepos *fpos, const wchar_t *name)
 
     if (charset == CS_NONE) {
        charset = CS_ASCII;
-       error(err_charset, fpos, name);
+       err_charset(fpos, name);
     }
 
     sfree(csname);