Skip to content

Commit 6d491a4

Browse files
committed
address review: unpack both components to tmp
1 parent c6ba315 commit 6d491a4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎Objects/memoryobject.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,15 +2066,15 @@ pack_single(PyMemoryViewObject *self, char *ptr, PyObject *item, const char *fmt
20662066
memcpy(ptr, &x, sizeof(x));
20672067
}
20682068
else {
2069-
char tmp[4];
2069+
char tmp[8];
20702070

20712071
if (PyFloat_Pack4(c.real, tmp, endian) < 0) {
20722072
goto err_occurred;
20732073
}
2074-
if (PyFloat_Pack4(c.imag, ptr + 4, endian) < 0) {
2074+
if (PyFloat_Pack4(c.imag, tmp + 4, endian) < 0) {
20752075
goto err_occurred;
20762076
}
2077-
memcpy(ptr, tmp, 4);
2077+
memcpy(ptr, tmp, 8);
20782078
}
20792079
break;
20802080

0 commit comments

Comments
 (0)