Ignore:
Timestamp:
2009-04-01T19:11:07Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d09f84e6
Parents:
1b0b48e0
Message:

strlen() → str_size().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    r1b0b48e0 r06b785f  
    138138                        spinlock_lock(&hlp->lock);
    139139                }
    140                 if ((strncmp(hlp->name, cmd->name, max(strlen(cmd->name),
    141                     strlen(hlp->name))) == 0)) {
     140                if ((strncmp(hlp->name, cmd->name, max(str_size(cmd->name),
     141                    str_size(hlp->name))) == 0)) {
    142142                        /* The command is already there. */
    143143                        spinlock_unlock(&hlp->lock);
     
    173173        int i;
    174174       
    175         for (i = strlen(str); i > pos; i--)
     175        for (i = str_size(str); i > pos; i--)
    176176                str[i] = str[i - 1];
    177177        str[pos] = ch;
     
    181181static const char *cmdtab_search_one(const char *name,link_t **startpos)
    182182{
    183         size_t namelen = strlen(name);
     183        size_t namelen = str_size(name);
    184184        const char *curname;
    185185
     
    194194
    195195                curname = hlp->name;
    196                 if (strlen(curname) < namelen)
     196                if (str_size(curname) < namelen)
    197197                        continue;
    198198                if (strncmp(curname, name, namelen) == 0) {
     
    223223                startpos = startpos->next;
    224224                if (!found)
    225                         strncpy(output, foundtxt, strlen(foundtxt) + 1);
     225                        strncpy(output, foundtxt, str_size(foundtxt) + 1);
    226226                else {
    227227                        for (i = 0; output[i] && foundtxt[i] &&
     
    235235                return 0;
    236236
    237         if (found > 1 && !strlen(output)) {
     237        if (found > 1 && !str_size(output)) {
    238238                printf("\n");
    239239                startpos = NULL;
     
    310310                                insert_char(current, tmp[i], i + position);
    311311
    312                         if (strlen(tmp) || found == 1) { /* If we have a hint */
     312                        if (str_size(tmp) || found == 1) { /* If we have a hint */
    313313                                for (i = position; i < curlen; i++)
    314314                                        putchar(current[i]);
    315                                 position += strlen(tmp);
     315                                position += str_size(tmp);
    316316                                /* Add space to end */
    317317                                if (found == 1 && position == curlen &&
     
    326326                                for (i = 0; i < curlen; i++)
    327327                                        putchar(current[i]);
    328                                 position += strlen(tmp);
     328                                position += str_size(tmp);
    329329                        }
    330330                        rdln_print_c('\b', curlen - position);
     
    385385                                current = history[histposition];
    386386                                printf("%s", current);
    387                                 curlen = strlen(current);
     387                                curlen = str_size(current);
    388388                                position = curlen;
    389389                                continue;
     
    444444        while (true) {
    445445                cmdline = clever_readline((char *) prompt, stdin);
    446                 len = strlen(cmdline);
     446                len = str_size(cmdline);
    447447                if (!len)
    448448                        continue;
     
    545545                spinlock_lock(&hlp->lock);
    546546               
    547                 if (strncmp(hlp->name, &cmdline[start], max(strlen(hlp->name),
     547                if (strncmp(hlp->name, &cmdline[start], max(str_size(hlp->name),
    548548                    end - start + 1)) == 0) {
    549549                        cmd = hlp;
Note: See TracChangeset for help on using the changeset viewer.