]> git.ozlabs.org Git - ccan/blobdiff - ccan/rune/test/run.c
ccan/rune: simplify check helper interfaces, allow explicit string lengths.
[ccan] / ccan / rune / test / run.c
index 6cf33a3dceefce6114f55a70e5354f7f5e211dc0..86737b86be11d2d338a8dd62674ec7ae99c0dc78 100644 (file)
@@ -22,10 +22,10 @@ static const char *check(const tal_t *ctx,
                char *endp;
                s64 v = strtol(val, &endp, 10);
                if (*endp == '\0' && endp != val)
-                       return rune_alt_single(ctx, alt, NULL, &v);
+                       return rune_alt_single_int(ctx, alt, v);
+               return rune_alt_single_str(ctx, alt, val, strlen(val));
        }
-
-       return rune_alt_single(ctx, alt, val, NULL);
+       return rune_alt_single_missing(ctx, alt);
 }
 
 int main(void)