Changeset 445e7c0 in mainline


Ignore:
Timestamp:
2013-06-11T14:18:12Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
55edba0
Parents:
136ce60
Message:

C style: fix usage of sizeof(void *)

Location:
uspace/app/bdsh
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/pwd/pwd.c

    r136ce60 r445e7c0  
    5555        }
    5656
    57         memset(buff, 0, sizeof(buff));
     57        memset(buff, 0, PATH_MAX);
    5858        getcwd(buff, PATH_MAX);
    5959
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r136ce60 r445e7c0  
    9999        if (NULL == (rm->nwd = (char *) malloc(PATH_MAX)))
    100100                return 0;
    101         memset(rm->nwd, 0, sizeof(rm->nwd));
     101        memset(rm->nwd, 0, PATH_MAX);
    102102
    103103        if (NULL == (rm->owd = (char *) malloc(PATH_MAX)))
    104104                return 0;
    105         memset(rm->owd, 0, sizeof(rm->owd));
     105        memset(rm->owd, 0, PATH_MAX);
    106106
    107107        if (NULL == (rm->cwd = (char *) malloc(PATH_MAX)))
    108108                return 0;
    109         memset(rm->cwd, 0, sizeof(rm->cwd));
     109        memset(rm->cwd, 0, PATH_MAX);
    110110
    111111        chdir(".");
     
    298298                        break;
    299299                }
    300                 memset(buff, 0, sizeof(buff));
     300                memset(buff, 0, len);
    301301                snprintf(buff, len, "%s", argv[i]);
    302302
  • uspace/app/bdsh/exec.c

    r136ce60 r445e7c0  
    8383        /* We now have n places to look for the command */
    8484        for (i = 0; search_dir[i] != NULL; i++) {
    85                 memset(found, 0, sizeof(found));
     85                memset(found, 0, PATH_MAX);
    8686                snprintf(found, PATH_MAX, "%s/%s", search_dir[i], cmd);
    8787                if (-1 != try_access(found)) {
Note: See TracChangeset for help on using the changeset viewer.