if (v == NULL)
return NULL;
if (size == 0)
- goto done;
+ return v;
p = q = PyString_AS_STRING(v);
while (i < size) {
*p = '\0';
if (_PyString_Resize(&v, p - q))
goto onError;
-
- done:
return v;
onError:
if (byteorder == 0)
*p++ = 0xFEFF;
if (size == 0)
- goto done;
+ return v;
if (byteorder == 0 ||
#ifdef BYTEORDER_IS_LITTLE_ENDIAN
byteorder == -1
Py_UNICODE ch = *s++;
*p++ = (ch >> 8) | (ch << 8);
}
- done:
return v;
}
repr = PyString_FromStringAndSize(NULL, 6 * size);
if (repr == NULL)
return NULL;
+ if (size == 0)
+ return repr;
p = q = PyString_AS_STRING(repr);
while (size-- > 0) {
{
PyObject *repr;
char *s, *start;
+
repr = PyString_FromStringAndSize(NULL, size);
if (repr == NULL)
return NULL;
+ if (size == 0)
+ return repr;
s = PyString_AS_STRING(repr);
start = s;
{
PyObject *repr;
char *s, *start;
+
repr = PyString_FromStringAndSize(NULL, size);
if (repr == NULL)
return NULL;
+ if (size == 0)
+ return repr;
s = PyString_AS_STRING(repr);
start = s;
repr = PyString_FromStringAndSize(NULL, mbcssize);
if (repr == NULL)
return NULL;
- if (mbcssize==0)
+ if (mbcssize == 0)
return repr;
/* Do the conversion */
v = PyString_FromStringAndSize(NULL, size);
if (v == NULL)
return NULL;
+ if (size == 0)
+ return v;
s = PyString_AS_STRING(v);
while (size-- > 0) {
Py_UNICODE ch = *p++;