Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/vfs/vfs1.c

    r210e50a r0b0f4bb  
    3030#include <stdio.h>
    3131#include <stdlib.h>
    32 #include <string.h>
     32#include <str.h>
    3333#include <vfs/vfs.h>
    3434#include <unistd.h>
     
    5454static char text[] = "Lorem ipsum dolor sit amet, consectetur adipisicing elit";
    5555
    56 static char *read_root(void)
     56static const char *read_root(void)
    5757{
    5858        TPRINTF("Opening the root directory...");
     
    7373}
    7474
    75 char *test_vfs1(void)
     75const char *test_vfs1(void)
    7676{
    7777        if (mkdir(MOUNT_POINT, 0) != 0)
     
    105105        if (cnt < 0)
    106106                return "write() failed";
    107         TPRINTF("Written %d bytes\n", cnt);
     107        TPRINTF("Written %zd bytes\n", cnt);
    108108       
    109109        if (lseek(fd0, 0, SEEK_SET) != 0)
     
    116116                        return "read() failed";
    117117               
    118                 TPRINTF("Read %d bytes: \".*s\"\n", cnt, cnt, buf);
     118                int _cnt = (int) cnt;
     119                if (_cnt != cnt) {
     120                        /* Count overflow, just to be sure. */
     121                        TPRINTF("Read %zd bytes\n", cnt);
     122                } else {
     123                        TPRINTF("Read %zd bytes: \"%.*s\"\n", cnt, _cnt, buf);
     124                }
    119125        }
    120126       
    121127        close(fd0);
    122128       
    123         char *rv = read_root();
     129        const char *rv = read_root();
    124130        if (rv != NULL)
    125131                return rv;
Note: See TracChangeset for help on using the changeset viewer.