Fix to bug 568: http://bugs.mariadb.com/show_bug.cgi?id=568
Changed strtok calls to strtok_r where needed.
This commit is contained in:
@ -158,6 +158,7 @@ int sendMessage(MYSQL* server, amqp_message_t* msg)
|
||||
(int)((msg->properties.correlation_id.len + 1)*2+1) +
|
||||
strlen(DB_INSERT),
|
||||
rval = 0;
|
||||
char* saved;
|
||||
char *qstr = calloc(buffsz,sizeof(char)),
|
||||
*rawmsg = calloc((msg->body.len + 1),sizeof(char)),
|
||||
*clnmsg = calloc(((msg->body.len + 1)*2+1),sizeof(char)),
|
||||
@ -170,9 +171,9 @@ int sendMessage(MYSQL* server, amqp_message_t* msg)
|
||||
|
||||
sprintf(qstr,"%.*s",(int)msg->body.len,(char *)msg->body.bytes);
|
||||
fprintf(out_fd,"Received: %s\n",qstr);
|
||||
char *ptr = strtok(qstr,"|");
|
||||
char *ptr = strtok_r(qstr,"|",&saved);
|
||||
sprintf(rawdate,"%s",ptr);
|
||||
ptr = strtok(NULL,"\n\0");
|
||||
ptr = strtok_r(NULL,"\n\0",&saved);
|
||||
if(ptr == NULL){
|
||||
fprintf(out_fd,"Message content not valid.\n");
|
||||
rval = 1;
|
||||
|
Reference in New Issue
Block a user