printobject now returns an error code
Remove superfluous err_nomem() call
This commit is contained in:
parent
76085b95b9
commit
bcaa31c411
@ -84,7 +84,7 @@ getstringvalue(op)
|
|||||||
|
|
||||||
/* Methods */
|
/* Methods */
|
||||||
|
|
||||||
static void
|
static int
|
||||||
stringprint(op, fp, flags)
|
stringprint(op, fp, flags)
|
||||||
stringobject *op;
|
stringobject *op;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -92,9 +92,10 @@ stringprint(op, fp, flags)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char c;
|
char c;
|
||||||
|
/* XXX Ought to check for interrupts when writing long strings */
|
||||||
if (flags & PRINT_RAW) {
|
if (flags & PRINT_RAW) {
|
||||||
fwrite(op->ob_sval, 1, (int) op->ob_size, fp);
|
fwrite(op->ob_sval, 1, (int) op->ob_size, fp);
|
||||||
return;
|
return 0;
|
||||||
}
|
}
|
||||||
fprintf(fp, "'");
|
fprintf(fp, "'");
|
||||||
for (i = 0; i < op->ob_size; i++) {
|
for (i = 0; i < op->ob_size; i++) {
|
||||||
@ -107,6 +108,7 @@ stringprint(op, fp, flags)
|
|||||||
putc(c, fp);
|
putc(c, fp);
|
||||||
}
|
}
|
||||||
fprintf(fp, "'");
|
fprintf(fp, "'");
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static object *
|
static object *
|
||||||
@ -117,7 +119,7 @@ stringrepr(op)
|
|||||||
int newsize = 2 + 4 * op->ob_size * sizeof(char);
|
int newsize = 2 + 4 * op->ob_size * sizeof(char);
|
||||||
object *v = newsizedstringobject((char *)NULL, newsize);
|
object *v = newsizedstringobject((char *)NULL, newsize);
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
return err_nomem();
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
register int i;
|
register int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user