Changeset 22 for trunk/src/slib.c
- Timestamp:
- Feb 23, 2006, 12:03:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/slib.c
r20 r22 231 231 if (flag == 1) 232 232 { 233 s printf (val, _("\n--------- %10s "), file);233 sl_snprintf (val, 81, _("\n--------- %10s "), file); 234 234 sl_strlcpy (msg, val, 80); 235 s printf (val, _(" --- %6d ---------\n"), line);235 sl_snprintf (val, 81, _(" --- %6d ---------\n"), line); 236 236 sl_strlcat (msg, val, 80); 237 237 sh_log_console (msg); … … 578 578 #if !defined(HOST_IS_I86SOLARIS) 579 579 #if !defined (_GNU_SOURCE) 580 /* flawfinder: ignore */ 580 581 extern int vsnprintf ( char *str, size_t n, 581 582 const char *format, va_list ap ); … … 777 778 778 779 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_BROKEN_VSNPRINTF) 779 len = vsnprintf (str, n, format, vl); 780 len = vsnprintf (str, n, format, vl); /* flawfinder: ignore */ 780 781 str[n-1] = '\0'; 781 782 #else 782 VA_COPY (vl2, vl); /* save the argument list */783 VA_COPY (vl2, vl); /* save the argument list */ 783 784 total = sl_printf_count (format, vl); 784 len 785 len = (int) total; 785 786 if (total < n) 786 787 { 788 /* flawfinder: ignore */ 787 789 vsprintf (str, format, vl2); /* program has checked that it fits */ 788 790 str[n-1] = '\0'; … … 804 806 * ENULL: src || format == NULL 805 807 * ERANGE: n out of range 806 * ETRUNC: truncated 808 * ETRUNC: truncated (unimplemented) 807 809 */ 808 810 int sl_snprintf(char *str, size_t n, … … 821 823 va_start (vl, format); 822 824 #if defined(HAVE_VSNPRINTF) && !defined(HAVE_BROKEN_VSNPRINTF) 825 /* flawfinder: ignore */ 823 826 vsnprintf (str, n, format, vl); 824 827 str[n-1] = '\0'; … … 828 831 if (total < n) 829 832 { 833 /* flawfinder: ignore */ 830 834 vsprintf (str, format, vl2); /* program has checked that it fits */ 831 835 str[n-1] = '\0'; … … 1568 1572 SL_TICKET sl_make_ticket (int fd, char * filename) 1569 1573 { 1574 size_t len; 1570 1575 SL_TICKET ticket; 1571 1576 SL_ENTER(_("sl_make_ticket")); … … 1587 1592 } 1588 1593 1589 if ( (ofiles[fd]->path = (char *) malloc( strlen(filename)+1) ) == NULL) 1594 len = sl_strlen(filename)+1; 1595 1596 if ( (ofiles[fd]->path = (char *) malloc(len) ) == NULL) 1590 1597 { 1591 1598 free(ofiles[fd]); … … 1605 1612 } 1606 1613 1607 s trcpy (ofiles[fd]->path, filename); /* Known to fit */1614 sl_strlcpy (ofiles[fd]->path, filename, len); 1608 1615 ofiles[fd]->ticket = ticket; 1609 1616 ofiles[fd]->fd = fd; … … 1646 1653 int fd; 1647 1654 int sflags; 1655 size_t len; 1648 1656 SL_TICKET ticket; 1649 1657 … … 1820 1828 } 1821 1829 1822 if ( (ofiles[fd]->path = (char *) malloc( strlen(filename)+1) ) == NULL) 1830 len = sl_strlen(filename)+1; 1831 1832 if ( (ofiles[fd]->path = (char *) malloc(len) ) == NULL) 1823 1833 { 1824 1834 free(ofiles[fd]); … … 1840 1850 } 1841 1851 1842 s trcpy (ofiles[fd]->path, filename); /* Known to fit */1852 sl_strlcpy (ofiles[fd]->path, filename, len); 1843 1853 ofiles[fd]->ticket = ticket; 1844 1854 ofiles[fd]->fd = fd;
Note:
See TracChangeset
for help on using the changeset viewer.