X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..3195a76cd3854870c3c9075e50dc90d99178c842:/projects/sgconf/sginfo.cpp?ds=sidebyside diff --git a/projects/sgconf/sginfo.cpp b/projects/sgconf/sginfo.cpp index 86352599..1c9048e7 100644 --- a/projects/sgconf/sginfo.cpp +++ b/projects/sgconf/sginfo.cpp @@ -182,9 +182,11 @@ double ParseCash(const char * c, string * message) double cash; char * msg; char * str; -str = new char[strlen(c)]; +str = new char[strlen(c) + 1]; + +strncpy(str, c, strlen(c)); +str[strlen(c)] = 0; -strcpy(str, c); msg = strchr(str, ':'); if (msg)