Changeset 572


Ignore:
Timestamp:
Mar 9, 2006, 2:24:06 PM (16 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added tests for malloc()'s
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/export.c

    r571 r572  
    5555
    5656    qq->html_buffer = malloc((13000 + ((qq->width*qq->height) * 40)) * sizeof(char));
     57    if(qq->html_buffer == NULL)
     58        return NULL;
     59
     60
    5761    cur = qq->html_buffer;
    5862
     
    133137
    134138    qq->html3_buffer = malloc((13000 + ((qq->width*qq->height)*40))*sizeof(char));
     139    if(qq->html3_buffer == NULL)
     140        return NULL;
     141
    135142    cur = qq->html3_buffer;
    136143
     
    215222
    216223    qq->irc_buffer = malloc((2 + (qq->width * qq->height * 11)) * sizeof(char));
     224    if(qq->irc_buffer == NULL)
     225        return NULL;
     226
    217227    cur = qq->irc_buffer;
    218228
     
    269279    *size = (strlen(qq->irc_buffer) + 1) * sizeof(char);
    270280    qq->irc_buffer = realloc(qq->irc_buffer, *size);
    271 
     281   
    272282    return qq->irc_buffer;
    273283}
     
    297307        free(qq->ansi_buffer);
    298308    qq->ansi_buffer = malloc(((qq->height*9) + (qq->width * qq->height * 20)) * sizeof(char));
     309    if(qq->ansi_buffer == NULL)
     310        return NULL;
     311
    299312    cur = qq->ansi_buffer;
    300313
Note: See TracChangeset for help on using the changeset viewer.