]> git.ozlabs.org Git - ccan/commitdiff
failtest, rbuf: fix up incorrect lseek arg order.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 4 Oct 2019 05:07:14 +0000 (14:37 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 4 Oct 2019 05:07:14 +0000 (14:37 +0930)
SEEK_SET == 0, so it's not hurting anyone now, but when I cut & paste
it elsewhere...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/failtest/test/run-open.c
ccan/rbuf/test/run-partial-read.c
ccan/rbuf/test/run-term-eof.c
ccan/rbuf/test/run.c

index 0166506480d897ea96f4b6ba33a5615109fb28ee..8b31ff71f35e73349e7ac1e9a060ef7014721c53 100644 (file)
@@ -29,7 +29,7 @@ int main(void)
        }
        /* Check it is read-write. */
        ok1(write(fd, buf, strlen(buf)) == strlen(buf));
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
        ok1(read(fd, buf, strlen("Hello world!")) == strlen("Hello world!"));
        ok1(strcmp(buf, "Hello world!") == 0);
 
index 7ecf79d35ea63d8fcc08cb6dea6cbaddcc191d85..8b5d901864de910e8668da83f11e462407061281 100644 (file)
@@ -31,7 +31,7 @@ int main(void)
 
        /* Grab ourselves for comparison. */
        buf[full_read(fd, buf, sizeof(buf))] = '\0';
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
 
        for (i = 0, p = buf; *p; i++) {
                lines[i] = p;
index 86d7c18d43a13832aed17a3f87177caaf2377430..0c346d7eac94ee83f9fd3614d501a4baec33843a 100644 (file)
@@ -27,7 +27,7 @@ int main(void)
        /* Grab ourselves for comparison. */
        len = read(fd, buf, sizeof(buf));
        buf[len] = '\0';
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
 
        /* We have exact-size buffer, which causes problems adding term. */
        rbuf_init(&in, fd, malloc(len), len, test_realloc);
@@ -44,7 +44,7 @@ int main(void)
        free(rbuf_cleanup(&in));
 
        /* Try again. */
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
        rbuf_init(&in, fd, malloc(len), len, test_realloc);
        p = rbuf_read_str(&in, 64);
        ok1(p);
@@ -53,7 +53,7 @@ int main(void)
        free(rbuf_cleanup(&in));
 
        /* Normal case, we get rbuf_start after nul */
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
        rbuf_init(&in, fd, NULL, 0, test_realloc);
        p = rbuf_read_str(&in, '^');
        ok1(p);
index 593ef2708b3d93d4e433c17edee2d4bdf9b09175..0f0e7d290f9ab0d4fe82dca33c21d53d8b544d89 100644 (file)
@@ -28,7 +28,7 @@ int main(void)
        /* Grab ourselves for comparison. */
        len = read(fd, buf, sizeof(buf));
        buf[len] = '\0';
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
 
        for (i = 0, p = buf; *p; i++) {
                lines[i] = p;
@@ -62,7 +62,7 @@ int main(void)
        free(rbuf_cleanup(&in));
 
        /* Another way of reading the entire (text) file. */
-       lseek(fd, SEEK_SET, 0);
+       lseek(fd, 0, SEEK_SET);
        rbuf_init(&in, fd, NULL, 0, test_realloc);
        p = rbuf_read_str(&in, 0);
        ok1(p);