Changeset 552


Ignore:
Timestamp:
Oct 31, 2019, 10:56:53 PM (12 months ago)
Author:
katerina
Message:

Fix gcc 9.2.1 (Ubuntu 19.10) compiler warnings.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/sh_utils.h

    r382 r552  
    179179/* returns freshly allocated memory, return value should be free'd
    180180 */
    181 char * sh_util_safe_name (const char * name) SH_GNUC_MALLOC SH_GNUC_PURE;
    182 
    183 char * sh_util_safe_name_keepspace (const char * name) SH_GNUC_MALLOC SH_GNUC_PURE;
     181char * sh_util_safe_name (const char * name) SH_GNUC_MALLOC;
     182
     183char * sh_util_safe_name_keepspace (const char * name) SH_GNUC_MALLOC;
    184184
    185185/* check max size of printf result string
  • trunk/src/sh_static.c

    r539 r552  
    17651765        if (buflen<256)
    17661766                return ERANGE;
    1767         strncpy(buf, name, buflen);
     1767        strncpy(buf, name, buflen-1);
    17681768
    17691769        /* First check if this is already an address */
     
    17921792                }
    17931793
    1794                 strncpy(buf, a.dotted, buflen);
     1794                strncpy(buf, a.dotted, buflen-1);
    17951795                free(a.dotted);
    17961796
     
    20132013                }
    20142014
    2015                 strncpy(buf, a.dotted, buflen);
     2015                strncpy(buf, a.dotted, buflen-1);
    20162016                free(a.dotted);
    20172017
  • trunk/src/slib.c

    r544 r552  
    257257    {
    258258      sl_snprintf    (val, 81, _("\n---------  %10s "), file);
    259       sl_strlcpy     (msg,    val,   80);
     259      sl_strlcpy     (msg,    val,   sizeof(msg));
    260260      sl_snprintf    (val, 81, _(" --- %6d ---------\n"), line);
    261       sl_strlcat     (msg,     val,   80);
     261      sl_strlcat     (msg,     val,   sizeof(msg));
    262262      sh_log_console (msg);
    263263    }
Note: See TracChangeset for help on using the changeset viewer.