@@ -238,7 +238,7 @@ static int nested_debug = 0;
238
238
static void write_debug ()
239
239
{
240
240
int x ;
241
- char s [25 ];
241
+ char s [26 ];
242
242
243
243
if (nested_debug ) {
244
244
/* Yoicks, if we have this there's serious trouble!
@@ -247,7 +247,7 @@ static void write_debug()
247
247
x = creat ("DEBUG.DEBUG" , 0644 );
248
248
if (x >= 0 ) {
249
249
setsock (x , SOCK_NONSOCK );
250
- strlcpy ( s , ctime ( & now ), sizeof s );
250
+ ctime_r ( & now , s );
251
251
dprintf (- x , "Debug (%s) written %s\n"
252
252
"Please report problem to https://github.com/eggheads/eggdrop/issues\n"
253
253
"Check doc/BUG-REPORT on how to do so." , ver , s );
@@ -275,8 +275,8 @@ static void write_debug()
275
275
if (x < 0 ) {
276
276
putlog (LOG_MISC , "*" , "* Failed to write DEBUG" );
277
277
} else {
278
- strlcpy ( s , ctime ( & now ), sizeof s );
279
- dprintf (- x , "Debug (%s) written %s\n " , ver , s );
278
+ ctime_r ( & now , s );
279
+ dprintf (- x , "Debug (%s) written %s" , ver , s );
280
280
#ifdef EGG_PATCH
281
281
dprintf (- x , "Patch level: %s\n" , EGG_PATCH );
282
282
#else
@@ -575,7 +575,7 @@ static void core_secondly()
575
575
}
576
576
nowmins = now / 60 ;
577
577
if (nowmins > lastmin ) {
578
- memcpy ( & nowtm , localtime ( & now ), sizeof ( struct tm ) );
578
+ localtime_r ( & now , & nowtm );
579
579
i = 0 ;
580
580
/* Once a minute */
581
581
++ lastmin ;
@@ -599,10 +599,11 @@ static void core_secondly()
599
599
check_botnet_pings ();
600
600
601
601
if (!miltime ) { /* At midnight */
602
- char s [25 ];
602
+ char s [26 ];
603
603
int j ;
604
604
605
- strlcpy (s , ctime (& now ), sizeof s );
605
+ ctime_r (& now , s );
606
+ s [24 ] = 0 ;
606
607
if (quiet_save < 3 )
607
608
putlog (LOG_ALL , "*" , "--- %.11s%s" , s , s + 20 );
608
609
call_hook (HOOK_BACKUP );
@@ -946,7 +947,7 @@ static void init_random(void) {
946
947
int main (int arg_c , char * * arg_v )
947
948
{
948
949
int i , j , xx ;
949
- char s [25 ];
950
+ char s [26 ];
950
951
FILE * f ;
951
952
struct sigaction sv ;
952
953
struct chanset_t * chan ;
@@ -1068,8 +1069,8 @@ int main(int arg_c, char **arg_v)
1068
1069
dns_thread_head = nmalloc (sizeof (struct dns_thread_node ));
1069
1070
dns_thread_head -> next = NULL ;
1070
1071
#endif
1071
- strlcpy ( s , ctime ( & now ), sizeof s );
1072
- memmove ( & s [ 11 ], & s [ 20 ], strlen ( & s [ 20 ]) + 1 ) ;
1072
+ ctime_r ( & now , s );
1073
+ s [ 24 ] = 0 ;
1073
1074
putlog (LOG_ALL , "*" , "--- Loading %s (%s)" , ver , s );
1074
1075
chanprog ();
1075
1076
if (!encrypt_pass2 && !encrypt_pass ) {
0 commit comments