Commit 7f248d60 authored by Vaibhav Gupta's avatar Vaibhav Gupta Committed by Federico Vaga

software: tools: fau-tg-config: Fix "[-Werror=stringop-truncation]"

In "main()", the "strncat()" is given the size equal to the destination
size. Thus, in worst case scenario, the string which needs to be
suffixed, will be truncated. Fix the warning.
Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
Reviewed-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 1d62702f
......@@ -188,7 +188,7 @@ int main(int argc, char *argv[])
exit(1);
}
strncat(basepath, argv[optind], base_len);
strncat(basepath, argv[optind], base_len - strlen(basepath));
printf("Sysfs path to device is: %s\n", basepath);
for (i = 0; i < FAU_TRIG_NUM_ATTR; ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment