[gnome-builder] editorconfig: fix warning when building without stack protection
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] editorconfig: fix warning when building without stack protection
- Date: Wed, 11 Apr 2018 21:30:37 +0000 (UTC)
commit 5ad9b41925ae41d11c4ae3919a6ff8f925abe126
Author: Christian Hergert <chergert redhat com>
Date: Wed Apr 11 14:30:07 2018 -0700
editorconfig: fix warning when building without stack protection
src/libeditorconfig/ini.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libeditorconfig/ini.c b/src/libeditorconfig/ini.c
index 5ea68380f..c01da5d64 100644
--- a/src/libeditorconfig/ini.c
+++ b/src/libeditorconfig/ini.c
@@ -90,7 +90,7 @@ static char* find_last_char_or_comment(const char* s, char c)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size)
{
- strncpy(dest, src, size);
+ strncpy(dest, src, size - 1);
dest[size - 1] = '\0';
return dest;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]