From e44f1a1446f8e72573e5a1026807e71a0495f88d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 18 Jun 2026 20:04:51 +0200 Subject: [PATCH] smb: constify `strchr()` result variable Fixing (as seen with gcc-15 on Ubuntu 26.04): ``` lib/smb.c: In function 'smb_connect': lib/smb.c:491:9: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 491 | slash = strchr(user, '/'); | ^ lib/smb.c:493:11: error: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 493 | slash = strchr(user, '\\'); | ^ ``` Ref: https://github.com/curl/curl/actions/runs/27778098314/job/82195462418?pr=22092 Follow-up to 4e5908306ad5febee88f7eae8ea3b0c41a6b7d84 #20428 Follow-up to 7dc60bdb90c710c2e36b2d05aa3686ff491a9bbe #20425 Follow-up to 0e2507a3c65376d6bda860ff20bd94ada9bbb9fd #20421 Cherry-picked from #22092 Closes #22094 --- lib/smb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/smb.c b/lib/smb.c index c06ca14fb3..70af8d5970 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -467,7 +467,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) { struct connectdata *conn = data->conn; struct smb_conn *smbc = Curl_conn_meta_get(conn, CURL_META_SMB_CONN); - char *slash; + const char *slash; const char *user = Curl_creds_user(conn->creds); (void)done;