diff options
Diffstat (limited to 'mq_cmd.c')
-rw-r--r-- | mq_cmd.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -36,7 +36,7 @@ mq_cmd* mq_cmd_create(int id, char *cmd, size_t cmd_sz, char *param, size_t para } //if not null string that everything will blow up pal //cmd[cmd_sz-1] = 0x0; - //param[param_sz-1] = 0x0; + //param[param_sz-1] = 0x0; snprintf(ret->buf,ret->sz-1,":%d:%s: %s", id, cmd, param); return ret; @@ -64,7 +64,6 @@ mq_cmd* mq_cmd_creates(char *str, size_t sz, int id) int mq_cmd_id(mq_cmd *cmd) { int i,j,strt,sz; - int ret=-1; int id_parse; char buf[16]; //fix this /*:[ID]:*/ @@ -109,9 +108,7 @@ int mq_cmd_id(mq_cmd *cmd) //be carefull int mq_cmd_cmd(mq_cmd *cmd, char **buf, size_t *sz) { - size_t sz_parse; - int i,j,strt,cnt,l_c; - char *p; + int i,strt,cnt,l_c; if (cmd == NULL) { @@ -129,8 +126,6 @@ int mq_cmd_cmd(mq_cmd *cmd, char **buf, size_t *sz) return -1; } - p = cmd->buf; - i = 0; l_c = 0; while ((cmd->buf[i] != 0)&&(i<cmd->sz)) @@ -165,11 +160,7 @@ int mq_cmd_cmd(mq_cmd *cmd, char **buf, size_t *sz) int mq_cmd_param(mq_cmd *cmd, char **param, size_t *sz) { - size_t sz_parse; - int i,j,strt,cnt,l_c; - char *p; - - p = cmd->buf; + int i,strt,l_c; i = 0; l_c = 0; @@ -286,7 +277,6 @@ int mq_cmd_o_cmp_cmd( mq_cmd *cmd, char *str) } str_sz = strlen(str); - if (strncmp(buf, str, str_sz) != 0) { return -1; |