Skip to content

Commit 6760a73

Browse files
committed
SDAP: fix discarded-qualifiers warnings in sdap_parse_range()
Make endptr and end_range `const char *` since they only hold strchr()/strrchr() results from const input strings. Introduce a separate `numendptr` variable for the strtouint32() output parameter. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e0fa18d commit 6760a73

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/providers/ldap/sdap_range.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx,
3434
{
3535
errno_t ret;
3636
TALLOC_CTX *tmp_ctx;
37-
char *endptr;
38-
char *end_range;
37+
const char *endptr;
38+
const char *end_range;
39+
char *numendptr;
3940
char *base;
4041
size_t rangestringlen = sizeof(SDAP_RANGE_STRING) - 1;
4142

@@ -119,8 +120,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx,
119120
goto done;
120121
}
121122

122-
*range_offset = strtouint32(end_range, &endptr, 10);
123-
if ((errno != 0) || (*endptr != '\0') || (end_range == endptr)) {
123+
*range_offset = strtouint32(end_range, &numendptr, 10);
124+
if ((errno != 0) || (*numendptr != '\0') || (end_range == numendptr)) {
124125
*range_offset = 0;
125126
ret = errno;
126127
DEBUG(SSSDBG_MINOR_FAILURE,

0 commit comments

Comments
 (0)