Lichen

Changeset

913:85cb541354aa
5 months ago Paul Boddie raw files shortlog changelog graph Silence warnings about incomplete string copying despite zero-initialised memory being used.
templates/native/locale.c (file)
     1.1 --- a/templates/native/locale.c	Thu Jul 16 16:56:24 2020 +0200
     1.2 +++ b/templates/native/locale.c	Wed Jun 16 00:52:29 2021 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  /* Native functions for locale handling.
     1.5  
     1.6 -Copyright (C) 2016, 2017 Paul Boddie <paul@boddie.org.uk>
     1.7 +Copyright (C) 2016, 2017, 2021 Paul Boddie <paul@boddie.org.uk>
     1.8  
     1.9  This program is free software; you can redistribute it and/or modify it under
    1.10  the terms of the GNU General Public License as published by the Free Software
    1.11 @@ -43,7 +43,7 @@
    1.12  
    1.13      length = strlen(result);
    1.14      out = __ALLOCATE(length + 1, sizeof(char));
    1.15 -    strncpy(out, result, length);
    1.16 +    strcpy(out, result);
    1.17  
    1.18      return __new_str(result, length);
    1.19  }
    1.20 @@ -64,7 +64,7 @@
    1.21  
    1.22      length = strlen(result);
    1.23      out = __ALLOCATE(length + 1, sizeof(char));
    1.24 -    strncpy(out, result, length);
    1.25 +    strcpy(out, result);
    1.26  
    1.27      return __new_str(result, length);
    1.28  }