Fix a silly invalid read operation

This commit is contained in:
Jan Vidar Krey 2010-05-28 15:23:44 +02:00
parent 1480b7e9c0
commit b3ed3a5526

View File

@ -756,7 +756,7 @@ char* adc_msg_get_argument(struct adc_message* cmd, int offset)
else
{
argument = hub_strdup(&start[1]);
if (argument && argument[strlen(argument)-1] == '\n')
if (argument && *argument && argument[strlen(argument)-1] == '\n')
argument[strlen(argument)-1] = 0;
}