diff --git a/modules/gmt/modgmt_internals.h b/modules/gmt/modgmt_internals.h index e8611cc..4b33dd9 100644 --- a/modules/gmt/modgmt_internals.h +++ b/modules/gmt/modgmt_internals.h @@ -33,7 +33,8 @@ inline struct GMT_OPTION* str2options(void *api, const char* str, size_t size=0) else { t=static_cast(malloc(size+1)); - memcpy(t,str,size+1); + memcpy(t,str,size); + t[size]=0; } struct GMT_OPTION* opts=GMT_Create_Options(api,0,t); GMT_Append_Option(api,GMT_Create_Options(api,0,default_gmt_options),opts);