Changeset 68c7516 in mainline for uspace/app/date/date.c


Ignore:
Timestamp:
2012-04-03T13:04:37Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d982e19
Parents:
02b38730
Message:

date: Fix devpath reading

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/date/date.c

    r02b38730 r68c7516  
    7575        }
    7676
    77         const char delim[] = {"/\0"};
    78         strtok(svc_name, delim);
    79         devpath = strtok(svc_name, delim);
     77        const char delim = '/';
     78        devpath = str_chr(svc_name, delim);
     79
     80        if (!devpath) {
     81                printf(NAME ": Device name format not recognized\n");
     82                goto exit;
     83        }
     84
     85        /* Skip the delimiter */
     86        devpath++;
    8087
    8188        printf("Found device %s\n", devpath);
Note: See TracChangeset for help on using the changeset viewer.