Skip to content
Snippets Groups Projects
Commit 03b407e1 authored by Sven M. Hallberg's avatar Sven M. Hallberg
Browse files

avoid gcc warning about strncpy

Fixes #100.
parent 26d6e974
Branches
No related tags found
No related merge requests found
......@@ -257,8 +257,9 @@ static char * h_get_string_for_backend_with_params__m(HAllocator *mm__,
/* fall back to the generic descriptive text */
generic_text = h_get_string_for_backend(be, description);
if (generic_text) {
text = h_new(char, strlen(generic_text) + 1);
strncpy(text, generic_text, strlen(generic_text) + 1);
size_t size = strlen(generic_text) + 1;
text = h_new(char, size);
strncpy(text, generic_text, size);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment