Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 4022513 in mainline


Ignore:
Timestamp:
2011-07-24T12:53:44Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
45cae6b
Parents:
8fd04ba
Message:

Devman should use str_dup(), no need for clone_string().

Location:
uspace/srv/devman
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r8fd04ba r4022513  
    422422        }
    423423       
    424         insert_fun_node(tree, fun, clone_string(""), NULL);
     424        insert_fun_node(tree, fun, str_dup(""), NULL);
    425425        match_id_t *id = create_match_id();
    426         id->id = clone_string("root");
     426        id->id = str_dup("root");
    427427        id->score = 100;
    428428        add_match_id(&fun->match_ids, id);
  • uspace/srv/devman/util.c

    r8fd04ba r4022513  
    9191}
    9292
    93 char *clone_string(const char *s)
    94 {
    95         size_t size = str_size(s) + 1;
    96         char *str;
    97        
    98         str = (char *) malloc(size);
    99         if (str != NULL)
    100                 str_cpy(str, size, s);
    101         return str;
    102 }
    103 
    10493void replace_char(char *str, char orig, char repl)
    10594{
  • uspace/srv/devman/util.h

    r8fd04ba r4022513  
    4444extern size_t get_nonspace_len(const char *);
    4545extern void free_not_null(const void *);
    46 extern char *clone_string(const char *);
    4746extern void replace_char(char *, char, char);
    4847
Note: See TracChangeset for help on using the changeset viewer.