Ignore:
Timestamp:
Mar 22, 2008, 11:03:33 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Use strdup(foo) everywhere instead of strcpy(malloc(strlen(foo)+1),foo);
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/status.cpp

    r129 r131  
    99
    1010#include "config.h"
     11
     12#include <string.h>
    1113
    1214#include "macs.hpp"
     
    2426  int last_update;
    2527  text_status_node(char const *Name, visual_object *Show, text_status_node *Next)
    26   { name=strcpy((char *)malloc(strlen(Name)+1),Name);
    27     show=Show;
    28     next=Next;
    29     last_update=0;
     28  { name = strdup(Name);
     29    show = Show;
     30    next = Next;
     31    last_update = 0;
    3032  }
    3133  ~text_status_node() { free(name); if (show) delete show; }
Note: See TracChangeset for help on using the changeset viewer.