strcpy( buf, *ch->desc->pString );
/*
* Truncate strings to MAX_STRING_LENGTH.
* ————————————–
*/
if ( strlen( buf ) + strlen( argument ) >= ( MAX_STRING_LENGTH - 4 ) )
{
send_to_char( "String too long, last line skipped.\r\n", ch );
/* Force character out of editing mode. */
ch->desc->pString = NULL;
return;
}
/*
* Ensure no tilde's inside string.
* ——————————–
*/
smash_tilde( argument );
strcat( buf, argument );
strcat( buf, "\r\n" );
free_string( *ch->desc->pString );
*ch->desc->pString = str_dup( buf );
return;
}
while ( *code1 == ' ' || *code1 == '\n' || *code1 == '\r' ) code1++;
code[(index(code1, '\n') - code1)] = '\0';
while ( *code1 == ' ' || *code1 == '\n' || *code1 == '\r' ) code1++;
*strstr(code1, "\n") = '\0';
strtok(code1, "\n");
timer = atoi(strtok(NULL, "\n"));
For reference, here is one of the GF progs:
Everything is pretty much working right, but where I'm running into trouble is when the *timer is a double digit number, as it seems to only be reading the first digit and ignoring the second.
Setting the timer in the GF Prog to 20, for example, will have that bug call show "2", etc.
I have some guesses as to where the problem is, but I've done very, very little code work that deals with string stuff like this, so I'm really at a loss. I do suspect all of the relevant code to the issue is contained in this function, though.
Any help would be greatly appreciated.