I did that plugin a long time ago and have learned to do things more elegantly/properly. I would change these lines:
PHP Code:
#define STATIC_MAX 64
#define STATIC_LEN 64
//...
new staticlist[STATIC_MAX][STATIC_LEN]
//...
new data[STATIC_LEN]
//...
while( !feof(f) && g_static_count < STATIC_MAX)
{
fgets(f, data, sizeof(data) - 1)
to
PHP Code:
// Removed, Not needed
//...
new staticlist[64][64]
//...
new data[sizeof(staticlist[])]
//...
while( !feof(f) && g_static_count < sizeof(staticlist))
{
fgets(f, data, charsmax(data))
You forgot this:
Quote:
Originally Posted by fysiks
- For obtaining the length of a string variable (array), use charsmax() instead of sizeof()-1.
|
__________________