Apply patch: ncpfs-hg-commit-442.patch

This commit is contained in:
Mario Fetka
2026-04-28 20:56:04 +02:00
parent 783da0a9d7
commit a3dffd8dd5
3 changed files with 66 additions and 6 deletions

View File

@@ -429,13 +429,13 @@ static void sap_report(int fd, const struct sap_server_ident *ident) {
}
}
static int sap_name_cmp(const unsigned char *my, const unsigned char *net, size_t cmplen) {
static int sap_name_cmp(const unsigned char *my, const char *net, size_t cmplen) {
if (memcmp(my, net, cmplen)) {
size_t ln;
/* If it is exact match, allow trailing spaces and garbage after
terminating zero. */
ln = strnlen(my, cmplen);
ln = strnlen((const char*)my, cmplen);
if (memcmp(my, net, ln)) {
return 1;
}
@@ -635,7 +635,7 @@ static NWCCODE sap_start(void **prh, UNUSED(NWCONN_HANDLE startConn),
if (ln >= NW_MAX_SERVER_NAME_LEN) {
return ENAMETOOLONG;
}
memcpy_toupper(sap_request + 4, name, ln);
memcpy_toupper((char*)sap_request + 4, name, ln);
if (ln < 48) {
memset(sap_request + 4 + ln, 0, 48 - ln);
}
@@ -650,7 +650,7 @@ static NWCCODE sap_start(void **prh, UNUSED(NWCONN_HANDLE startConn),
if (ln >= NW_MAX_SERVER_NAME_LEN) {
return ENAMETOOLONG;
}
memcpy_toupper(sap_request + 4, name, ln);
memcpy_toupper((char*)sap_request + 4, name, ln);
if (ln <= 32) {
if (ln < 32) {
memset(sap_request + 4 + ln, '_', 32 - ln);