tAdd argument to %s substitution, check lseek return value, simplify error code. - ratox - FIFO based tox client
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 71509797219d3cf18a77657ec31ad2e215e13a5d
 (DIR) parent a5a18a2b84f29595a85bca039df184a454443093
 (HTM) Author: pranomostro <pranomostro@posteo.net>
       Date:   Sat,  3 Jun 2017 20:31:30 +0200
       
       Add argument to %s substitution, check lseek return value, simplify error code.
       
       Diffstat:
         M ratox.c                             |       7 +++++--
       
       1 file changed, 5 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/ratox.c b/ratox.c
       t@@ -1218,7 +1218,10 @@ reprompt1:
                lseek(fd, 0, SEEK_SET);
        
                if (sz == 0) {
       -                weprintf("Datafile is empty\n", savefile);
       +                weprintf("Datafile %s is empty\n", savefile);
       +                return;
       +        } else if (sz < 0) {
       +                weprintf("Datafile %s can't be seeked\n", savefile);
                        return;
                }
        
       t@@ -1369,7 +1372,7 @@ localinit(void)
                /* Dump ID */
                idfd = open("id", O_WRONLY | O_CREAT, 0666);
                if (idfd < 0)
       -                eprintf("open %s:", "id");
       +                eprintf("open id:");
                tox_self_get_address(tox, address);
                for (i = 0; i < TOX_ADDRESS_SIZE; i++)
                        dprintf(idfd, "%02X", address[i]);