[PATCH app-xscope] Use strncpy rather than strlcpy as it is not available on Linux

Gaetan Nadon memsize at videotron.ca
Wed Jun 9 10:58:05 PDT 2010


Because it is available on other platforms, it only fails on Linux.
strncpy should be safe enough in this situation where a constant is copied.
The xserver private impl of strlcpy is not available to apps.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 scope.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scope.c b/scope.c
index e33c9d9..758fd19 100644
--- a/scope.c
+++ b/scope.c
@@ -337,7 +337,7 @@ ReadCommands (void)
 	printf ("> ");
 	if (!fgets (line, sizeof line, stdin)) {
 	    if(feof(stdin)) {
-		strlcpy(line, "quit", sizeof(line));
+		strncpy(line, "quit", sizeof(line));
 	    } else {
 		printf("Error: %s\n", strerror(errno));
 		break;
-- 
1.6.0.4

Ignore the previous, almost identical patch.



More information about the xorg-devel mailing list