libmp: check nil return value of strtomp() in test program
This commit is contained in:
parent
263b0e34b2
commit
5aeddd6788
1 changed files with 4 additions and 2 deletions
|
@ -40,7 +40,8 @@ testconv(char *str)
|
|||
for(i=0; i<nelem(base); i++){
|
||||
p = mptoa(b, base[i], nil, 0);
|
||||
print("base%d: %s = ", base[i], p);
|
||||
strtomp(p, nil, base[i], b);
|
||||
if(strtomp(p, nil, base[i], b) == nil)
|
||||
abort();
|
||||
free(p);
|
||||
print("%B\n", b, base[i], b);
|
||||
|
||||
|
@ -51,7 +52,8 @@ testconv(char *str)
|
|||
case 16:
|
||||
p = smprint("%#.*B", base[i], b);
|
||||
print("# %s = ", p);
|
||||
strtomp(p, nil, 0, b);
|
||||
if(strtomp(p, nil, 0, b) == nil)
|
||||
abort();
|
||||
free(p);
|
||||
print("%#.*B\n", base[i], b);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue