Changeset 688 in MondoRescue for trunk/mondo/mondo/common/libmondo-string.c


Ignore:
Timestamp:
Jul 17, 2006, 3:44:46 PM (18 years ago)
Author:
bcornec
Message:

Huge memory management patch.
Still not finished but a lot as been done.
What remains is around some functions returning strings, and some structure members.
(Could not finish due to laptop failure !)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mondo/mondo/common/libmondo-string.c

    r672 r688  
    3333 * @note If @p drive ends in a digit, then 'p' (on Linux) or 's' (on *BSD) is added before @p partno.
    3434 */
    35 char *build_partition_name(char *partition, const char *drive, int partno)
     35char *build_partition_name(const char *drive, int partno)
    3636{
    3737    char *p, *c;
    38 
    39     assert(partition != NULL);
     38    char *partition;
     39
    4040    assert_string_is_neither_NULL_nor_zerolength(drive);
    4141    assert(partno >= 0);
     
    537537
    538538    /*@ buffers **************************************************** */
    539     char *output;
    540     char *suffix;
     539    char *output = NULL;
     540    char *suffix = NULL;
    541541
    542542    /*@ end vars *************************************************** */
    543543
    544544    assert_string_is_neither_NULL_nor_zerolength(path);
    545     if (s[0] != '\0') {
     545
     546    if (s != NULL) {
    546547        asprintf(&suffix, ".%s", s);
    547548    } else {
    548         asprintf(&suffix, "%s", " ");
     549        asprintf(&suffix, "%s", "");
    549550    }
    550551    asprintf(&output, "%s/slice-%07ld.%05ld.dat%s", path, bigfileno,
Note: See TracChangeset for help on using the changeset viewer.