atoi booboo - accepts 1, not 2 params! :)
authorCarsten Haitzler <raster@rasterman.com>
Sat, 8 Jan 2005 08:57:00 +0000 (08:57 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Sat, 8 Jan 2005 08:57:00 +0000 (08:57 +0000)
SVN revision: 12824

legacy/embryo/examples/test.sma
legacy/embryo/src/lib/embryo_str.c

index 2bd4e76..06853db 100644 (file)
@@ -106,6 +106,8 @@ main()
    native_rec(1, "Smelly", 77);
    printf("native_rec() done\n");
    
+   printf("atoi(\"7\") = %i\n", atoi("7"));
+   
    return 7;
 }
 
index 2f460f3..d98adef 100644 (file)
@@ -24,7 +24,7 @@ _embryo_str_atoi(Embryo_Program *ep, Embryo_Cell *params)
    char *s1;
    
    /* params[1] = str */
-   if (params[0] != (2 * sizeof(Embryo_Cell))) return 0;
+   if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
    STRGET(ep, s1, params[1]);
    if (!s1) return 0;
    return (Embryo_Cell)atoi(s1);