Ignore:
Timestamp:
Mar 22, 2008, 11:03:33 AM (12 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/console.cpp

    r129 r131  
    1212#include <ctype.h>
    1313#include <stdarg.h>
     14#include <string.h>
    1415
    1516#include "game.hpp"
     
    8586  lastx=xres/2-screen_w()/2;
    8687  lasty=yres/2-screen_h()/2;
    87   name=(char *)strcpy((char *)malloc(strlen(Name)+1),Name);
     88  name = strdup(Name);
    8889}
    8990
Note: See TracChangeset for help on using the changeset viewer.