1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/pgsql: pg_lo_read addressing the todo. (#11159)

This commit is contained in:
David CARLIER
2023-05-05 12:41:52 +01:00
committed by GitHub
parent bb38ad7768
commit 2e0f75ec14

View File

@@ -2490,9 +2490,8 @@ PHP_FUNCTION(pg_lo_read)
RETURN_FALSE;
}
/* TODO Use truncate API? */
ZSTR_LEN(buf) = nbytes;
ZSTR_VAL(buf)[ZSTR_LEN(buf)] = '\0';
ZSTR_VAL(buf)[nbytes] = '\0';
buf = zend_string_truncate(buf, nbytes, 0);
RETURN_NEW_STR(buf);
}
/* }}} */