| 863 |
|
void ONICALL SLrDaodan_Register_ReturnType(char* name, char* desc, char* argfmt, sl_type type, sl_func callback) { |
| 864 |
|
char argfmt2[512]; |
| 865 |
|
uint16_t errornum; |
| 866 |
< |
sprintf_s(argfmt2, 512, "%s [|]", argfmt); |
| 867 |
< |
errornum = SLrScript_Command_Register_ReturnType(name, desc, argfmt2, type, callback); |
| 868 |
< |
if(errornum) |
| 869 |
< |
{ |
| 870 |
< |
DDrStartupMessage("Registration of script command %s failed with error %i", name, errornum); |
| 866 |
> |
if (argfmt && strlen(argfmt) < 507) { |
| 867 |
> |
sprintf(argfmt2, "%s [|]", argfmt); |
| 868 |
> |
errornum = SLrScript_Command_Register_ReturnType(name, desc, argfmt2, type, callback); |
| 869 |
> |
if(errornum) |
| 870 |
> |
{ |
| 871 |
> |
DDrStartupMessage("Registration of script command %s failed with error %i", name, errornum); |
| 872 |
> |
} |
| 873 |
> |
} else { |
| 874 |
> |
DDrStartupMessage("Registration of script command %s failed because of a too long argfmt", name); |
| 875 |
|
} |
| 872 |
– |
|
| 876 |
|
} |
| 877 |
|
|
| 878 |
|
void* TSrTest = 0; |