Colin spotted a sizeof/lenof confusion which we think has been
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 4 Aug 2004 16:25:06 +0000 (16:25 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 4 Aug 2004 16:25:06 +0000 (16:25 +0000)
causing segfaults on strange architectures.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4398 cda61777-01e9-0310-a592-d414129be87e

contents.c

index 35143cd..2acf81e 100644 (file)
@@ -69,7 +69,7 @@ static void dospace(word ***wret) {
 
 static void donumber(word ***wret, int num) {
     wchar_t text[20];
-    wchar_t *p = text + sizeof(text);
+    wchar_t *p = text + lenof(text);
     *--p = L'\0';
     while (num != 0) {
        assert(p > text);
@@ -93,7 +93,7 @@ static void doanumber(word ***wret, int num) {
        else
            aton = INT_MAX;
     }
-    p = text + sizeof(text);
+    p = text + lenof(text);
     *--p = L'\0';
     while (nletters--) {
        assert(p > text);