va_list args;\r
int len;\r
va_start(args, Message);\r
- len = vsnprintf(NULL, 1000, Message, args);\r
+ len = vsnprintf(NULL, 0, Message, args);\r
{\r
char buf[len+1];\r
vsnprintf(buf, len+1, Message, args);\r
}\r
\r
//printf("[%s] NOTICE %s: %s\n", Server->Name, ident, message);\r
+ char *ident_bang = strchr(ident, '!');\r
+ if( ident_bang ) {\r
+ *ident_bang = '\0';\r
+ }\r
Message_Append(Server, MSG_TYPE_NOTICE, ident, "", message);\r
}\r
else if( strcmp(cmd, "PRIVMSG") == 0 )\r
// TODO: Catch when the privmsg is addressed to the user\r
\r
// Cmd_PRIVMSG(Server, dest, ident, message);\r
- *strchr(ident, '!') = '\0'; // Hello SIGSEGV\r
+ char *ident_bang = strchr(ident, '!');\r
+ if( ident_bang ) {\r
+ *ident_bang = '\0';\r
+ }\r
Message_Append(Server, MSG_TYPE_STANDARD, ident, dest, message);\r
}\r
else if( strcmp(cmd, "JOIN" ) == 0 )\r
int len;\r
\r
va_start(args, Format);\r
- len = vsnprintf(NULL, 1000, Format, args);\r
+ len = vsnprintf(NULL, 0, Format, args);\r
va_end(args);\r
\r
{\r
if(Filename)
{
- int len = snprintf(NULL, 100, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename);
+ int len = snprintf(NULL, 0, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename);
char path[len+1];
- snprintf(path, 100, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename);
+ snprintf(path, len+1, "/Devices/ip/routes/@%i:%s/%s", AddrType, hexAddr, Filename);
_SysDebug("%s", path);
return _SysOpen(path, OPENFLAG_READ|OPENFLAG_WRITE);
}
else
{
- int len = snprintf(NULL, 100, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr);
+ int len = snprintf(NULL, 0, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr);
char path[len+1];
- snprintf(path, 100, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr);
+ snprintf(path, len+1, "/Devices/ip/routes/@%i:%s", AddrType, hexAddr);
return _SysOpen(path, OPENFLAG_READ);
}
}