Changeset 552 for trunk/src


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

Fix gcc 9.2.1 (Ubuntu 19.10) compiler warnings.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.