ports/net/pecl-smbclient/files/patch-smbclient.c
Po-Chuan Hsieh 983d161bf1
net/pecl-smbclient: Fix build warning on i386
/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1205:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
                php_error(E_WARNING, "Negative byte count: %ld", count);
                                                           ~~~   ^~~~~
                                                           %d
/wrkdirs/usr/ports/net/pecl-smbclient/work-php81/smbclient-1.1.1/smbclient.c:1256:52: warning: format specifies type 'long' but the argument has type 'zend_long' (aka 'int') [-Wformat]
                php_error(E_WARNING, "Negative byte count: %ld", count);
                                                           ~~~   ^~~~~
                                                           %d
2 warnings generated.
2023-09-06 04:46:28 +08:00

20 lines
596 B
C

--- smbclient.c.orig 2023-04-17 03:27:10 UTC
+++ smbclient.c
@@ -1202,7 +1202,7 @@ PHP_FUNCTION(smbclient_read)
return;
}
if (count < 0) {
- php_error(E_WARNING, "Negative byte count: %ld", count);
+ php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
RETURN_FALSE;
}
STATE_FROM_ZSTATE;
@@ -1253,7 +1253,7 @@ PHP_FUNCTION(smbclient_write)
return;
}
if (count < 0) {
- php_error(E_WARNING, "Negative byte count: %ld", count);
+ php_error(E_WARNING, "Negative byte count: " ZEND_LONG_FMT, count);
RETURN_FALSE;
}
if (count == 0 || count > str_len) {