]> git.ozlabs.org Git - ccan/blobdiff - ccan/string/test/run-grab.c
grab_fd and grab_file: add a size arg, use everywhere.
[ccan] / ccan / string / test / run-grab.c
index 96b9dac852b428224171563e608c6126ec1e1f0f..2b36a0fb70d77ba03b59ae83cb64ab66e6acb56b 100644 (file)
@@ -1,24 +1,4 @@
 /* This is test for grab_file() function
- *
- * Example:
- * 
- * void *grab_file(const void *ctx, const char *filename)
- *     {
- *     int fd; 
- *     char *buffer;
- * 
- *     if (streq(filename, "-"))
- *             fd = dup(STDIN_FILENO);
- *     else
- *             fd = open(filename, O_RDONLY, 0); 
- *
- *     if (fd < 0)
- *             return NULL; 
- *
- *     buffer = grab_fd(ctx, fd);
- *     close_noerr(fd);
- *     return buffer;
- *     }
  */
 
 #include       <stdlib.h>
@@ -37,7 +17,7 @@ main(int argc, char *argv[])
        int             length;
        struct          stat st;
 
-       str = grab_file(NULL, "ccan/string/test/run-grab.c");
+       str = grab_file(NULL, "ccan/string/test/run-grab.c", NULL);
        split = strsplit(NULL, str, "\n", NULL);
        length = strlen(split[0]);
        ok1(streq(split[0], "/* This is test for grab_file() function"));