Skip to content

Commit 96fc3a5

Browse files
committed
vcap/ximea: avoid gcc warning
``` ultragrid/src/video_capture/ximea.c:100:27: warning: variable length array folded to constant array as an extension [-Wgnu-folding-constant] 100 | char path[strlen(XIMEA_LIBRARY_PATH) + 1 + strlen(XIMEA_LIBRARY_NAME) + 1]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. ``` Both XIMEA_LIBRARY_PATH and XIMEA_LIBRARY_NAME are actually char[] defined in config.h.
1 parent 02db6ee commit 96fc3a5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/video_capture/ximea.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Martin Pulec <[email protected]>
44
*/
55
/*
6-
* Copyright (c) 2019-2023 CESNET, z. s. p. o.
6+
* Copyright (c) 2019-2025 CESNET
77
* All rights reserved.
88
*
99
* Redistribution and use in source and binary forms, with or without
@@ -97,7 +97,8 @@ static bool vidcap_ximea_fill_symbols(struct ximea_functions *f) {
9797
if (!f->handle) {
9898
log_msg(LOG_LEVEL_VERBOSE, MOD_NAME "Unable to open library %s): %s!\n",
9999
XIMEA_LIBRARY_NAME, dlerror());
100-
char path[strlen(XIMEA_LIBRARY_PATH) + 1 + strlen(XIMEA_LIBRARY_NAME) + 1];
100+
char path[(sizeof XIMEA_LIBRARY_PATH - 1) + 1 +
101+
(sizeof XIMEA_LIBRARY_NAME - 1) + 1];
101102
strcpy(path, XIMEA_LIBRARY_PATH);
102103
strcat(path, "/");
103104
strcat(path, XIMEA_LIBRARY_NAME);

0 commit comments

Comments
 (0)