return;
buf = xmalloc(INT_TO_STRING_LEN);
- sscanf(buf,"%d", &len);
+ sprintf(buf,"%d", len);
set_var(pv->varcode, buf);
free_string(buf);
}
return;
buf = xmalloc(INT_TO_STRING_LEN);
- sscanf(buf,"%d", &code);
+ sprintf(buf,"%d", code);
set_var(pv->varcode, buf);
free_string(buf);
}
found = 1;
free_string(ph->value);
ph->value = xmalloc(INT_TO_STRING_LEN);
- sscanf(ph->value, "%d", &len);
+ sprintf(ph->value, "%d", len);
break;
}
}
char* buf, * tmpbuf;
buf = xmalloc(INT_TO_STRING_LEN + strlen(clheader));
tmpbuf = xmalloc(INT_TO_STRING_LEN);
- sscanf(tmpbuf, "%d", &len);
+ sprintf(tmpbuf, "%d", len);
+ strcpy(buf, clheader);
strcat(buf, tmpbuf);
new_header(buf, h);
free_string(buf);
LIST_FOREACH(p, ins) {
switch (p->opcode) {
case OPC_SET:
- set_var(p->u.set.l, get_var(p->u.set.r));
+ result = get_var(p->u.set.r);
+ set_var(p->u.set.l, result);
+ free_string(result);
break;
case OPC_JUMP:
p = p->u.jump.target;
break;
case OPC_NOT:
result = xmalloc(INT_TO_STRING_LEN);
- sscanf(get_var(p->u.tpop.l),"%d", &v);
+ sscanf(get_var(p->u.dpop.par),"%d", &v);
sprintf(result, "%d", !v);
- set_var(p->u.tpop.res, result);
+ set_var(p->u.dpop.res, result);
+ free_string(result);
+ break;
case OPC_CAT:
case OPC_RE:
case OPC_NRE: