diff mbox series

main: remove static from const strlen

Message ID DM4PR14MB488070291579BF883BDD0195A8A62@DM4PR14MB4880.namprd14.prod.outlook.com (mailing list archive)
State Accepted, archived
Headers show
Series main: remove static from const strlen | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-alpine-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-incremental_build success Incremental build not run PASS
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

Kasper Kantz July 12, 2024, 7:32 p.m. UTC
src/p2putil.c: In function 'p2p_get_random_string':
 src/p2putil.c:2641:37: error: initializer element is not constant     2641 |
        static const int set_size = strlen(CHARSET);         |
                     ^~~~~~
---
 src/p2putil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Denis Kenzior July 12, 2024, 9:25 p.m. UTC | #1
Hi Kasper,

On 7/12/24 2:32 PM, Kasper Kantz wrote:
>   src/p2putil.c: In function 'p2p_get_random_string':
>   src/p2putil.c:2641:37: error: initializer element is not constant     2641 |
>          static const int set_size = strlen(CHARSET);         |
>                       ^~~~~~
> ---
>   src/p2putil.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

I modified the prefix to read: p2putil: (s/main/p2putil)

Applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/src/p2putil.c b/src/p2putil.c
index d1f114d0..ef0f988c 100644
--- a/src/p2putil.c
+++ b/src/p2putil.c
@@ -2638,7 +2638,7 @@  void p2p_get_random_string(char *buf, size_t len)
 {
 #define CHARSET "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" \
 		"0123456789"
-	static const int set_size = strlen(CHARSET);
+	const int set_size = strlen(CHARSET);
 
 	l_getrandom(buf, len);