Changeset 92fd52d7 in mainline for uspace/app


Ignore:
Timestamp:
2009-04-09T21:16:50Z (17 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7afb4a5
Parents:
a2c58f6
Message:

Nuke strcpy() and strcmp().

Location:
uspace/app
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtin_cmds.c

    ra2c58f6 r92fd52d7  
    5050
    5151        for (cmd = builtins; cmd->name != NULL; cmd++, i++) {
    52                 if (!strcmp(cmd->name, command))
     52                if (!str_cmp(cmd->name, command))
    5353                        return i;
    5454        }
     
    6565
    6666        for(i=0; builtin_aliases[i] != NULL; i+=2) {
    67                 if (!strcmp(builtin_aliases[i], command))
     67                if (!str_cmp(builtin_aliases[i], command))
    6868                        return 1;
    6969        }
     
    8080
    8181        for(i=0; builtin_aliases[i] != NULL; i++) {
    82                 if (!strcmp(builtin_aliases[i], command))
     82                if (!str_cmp(builtin_aliases[i], command))
    8383                        return (char *)builtin_aliases[++i];
    8484                i++;
  • uspace/app/bdsh/cmds/mod_cmds.c

    ra2c58f6 r92fd52d7  
    6565
    6666        for (mod = modules; mod->name != NULL; mod++, i++) {
    67                 if (!strcmp(mod->name, command))
     67                if (!str_cmp(mod->name, command))
    6868                        return i;
    6969        }
     
    8282
    8383        for(i=0; mod_aliases[i] != NULL; i+=2) {
    84                 if (!strcmp(mod_aliases[i], command))
     84                if (!str_cmp(mod_aliases[i], command))
    8585                        return 1;
    8686        }
     
    9898
    9999        for(i=0; mod_aliases[i] != NULL; i++) {
    100                 if (!strcmp(mod_aliases[i], command))
     100                if (!str_cmp(mod_aliases[i], command))
    101101                        return (char *)mod_aliases[++i];
    102102                i++;
  • uspace/app/bdsh/cmds/modules/help/help.c

    ra2c58f6 r92fd52d7  
    108108
    109109        if (argc == 3) {
    110                 if (!strcmp("extended", argv[2]))
     110                if (!str_cmp("extended", argv[2]))
    111111                        level = HELP_LONG;
    112112                else
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    ra2c58f6 r92fd52d7  
    150150                /* Sometimes make or scripts conjoin odd paths. Account for something
    151151                 * like this: ../../foo/bar/../foo/foofoo/./bar */
    152                 if (!strcmp(dirs[i], "..") || !strcmp(dirs[i], ".")) {
     152                if (!str_cmp(dirs[i], "..") || !str_cmp(dirs[i], ".")) {
    153153                        if (0 != (chdir(dirs[i]))) {
    154154                                cli_error(CL_EFAIL, "%s: impossible path: %s",
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    ra2c58f6 r92fd52d7  
    217217        i = optind;
    218218        while (NULL != argv[i]) {
    219                 len = strlen(argv[i]) + 2;
     219                len = str_size(argv[i]) + 2;
    220220                buff = (char *) realloc(buff, len);
    221221                if (buff == NULL) {
  • uspace/app/bdsh/exec.c

    ra2c58f6 r92fd52d7  
    7272        char *path[PATH_MAX];
    7373        int n = 0, i = 0;
    74         size_t x = strlen(cmd) + 2;
     74        size_t x = str_size(cmd) + 2;
    7575
    7676        found = (char *)malloc(PATH_MAX);
     
    8686        path[n] = strtok(path_tok, PATH_DELIM);
    8787        while (NULL != path[n]) {
    88                 if ((strlen(path[n]) + x ) > PATH_MAX) {
     88                if ((str_size(path[n]) + x ) > PATH_MAX) {
    8989                        cli_error(CL_ENOTSUP,
    9090                                "Segment %d of path is too large, search ends at segment %d",
  • uspace/app/bdsh/input.c

    ra2c58f6 r92fd52d7  
    147147{
    148148        char line[INPUT_MAX];
    149         size_t len = 0;
    150149
    151150        console_set_style(STYLE_EMPHASIS);
     
    154153
    155154        read_line(line, INPUT_MAX);
    156         len = strlen(line);
    157155        /* Make sure we don't have rubbish or a C/R happy user */
    158         if (len == 0 || line[0] == '\n')
     156        if (str_cmp(line, "") == 0 || str_cmp(line, "\n") == 0)
    159157                return;
    160158        usr->line = strdup(line);
  • uspace/app/tester/devmap/devmap1.c

    ra2c58f6 r92fd52d7  
    141141        req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer);
    142142
    143         retval = ipc_data_write_start(phone, (char *)name, strlen(name) + 1);
     143        retval = ipc_data_write_start(phone, (char *)name, str_size(name) + 1);
    144144
    145145        if (retval != EOK) {
     
    174174            &answer);
    175175
    176         retval = ipc_data_write_start(driver_phone, name, strlen(name) + 1);
     176        retval = ipc_data_write_start(driver_phone, name, str_size(name) + 1);
    177177
    178178        if (retval != EOK) {
     
    216216
    217217        retval = ipc_data_write_start(driver_phone, (char *)name,
    218             strlen(name) + 1);
     218            str_size(name) + 1);
    219219
    220220        if (retval != EOK) {
  • uspace/app/tetris/scores.c

    ra2c58f6 r92fd52d7  
    290290/*      me = thisuser(); */
    291291/*      for (i = 0, sp = &scores[0]; i < nscores; i++, sp++) { */
    292 /*              if (sp->hs_level != level || strcmp(sp->hs_name, me) != 0) */
     292/*              if (sp->hs_level != level || str_cmp(sp->hs_name, me) != 0) */
    293293/*                      continue; */
    294294/*              if (score > sp->hs_score) { */
     
    418418/*               *\/ */
    419419/*              for (j = 0, pu = count; j < numnames; j++, pu++) */
    420 /*                      if (strcmp(sp->hs_name, pu->name) == 0) */
     420/*                      if (str_cmp(sp->hs_name, pu->name) == 0) */
    421421/*                              break; */
    422422/*              if (j == numnames) { */
     
    555555/*                  sp->hs_level == level && */
    556556/*                  sp->hs_score == score && */
    557 /*                  strcmp(sp->hs_name, me) == 0) { */
     557/*                  str_cmp(sp->hs_name, me) == 0) { */
    558558/*                      putpad(SOstr); */
    559559/*                      highlight = 1; */
  • uspace/app/tetris/screen.c

    ra2c58f6 r92fd52d7  
    281281{
    282282       
    283         int l = strlen(s);
     283        int l = str_size(s);
    284284       
    285285        moveto(Rows - 2, ((Cols - l) >> 1) - 1);
  • uspace/app/tetris/tetris.c

    ra2c58f6 r92fd52d7  
    278278/*                      break; */
    279279/*              case 'k': */
    280 /*                      if (strlen(keys = optarg) != 6) */
     280/*                      if (str_size(keys = optarg) != 6) */
    281281/*                              usage(); */
    282282/*                      break; */
Note: See TracChangeset for help on using the changeset viewer.