xcursor: use memcpy() to append string of known size
Since len <= strlen(elt) is known, we don't need a str*() function. Let's simply do memcpy() to suppress linter false positive. Fixes #2777.
This commit is contained in:
		
							parent
							
								
									a71d565138
								
							
						
					
					
						commit
						3c5cc02b18
					
				|  | @ -655,11 +655,8 @@ _XcursorAddPathElt (char *path, const char *elt, int len) | |||
| 	elt++; | ||||
| 	len--; | ||||
|     } | ||||
| #pragma GCC diagnostic push | ||||
| #pragma GCC diagnostic ignored "-Wstringop-truncation" | ||||
|     strncpy (path + pathlen, elt, len); | ||||
|     memcpy (path + pathlen, elt, len); | ||||
|     path[pathlen + len] = '\0'; | ||||
| #pragma GCC diagnostic pop | ||||
| } | ||||
| 
 | ||||
| static char * | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue