Skip to content

Commit 42d7102

Browse files
committed
profiler: rtlib: fix gcc warnings
1 parent 7b6bca5 commit 42d7102

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/rtlib/profile.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,11 @@ FB_PROFILER_GLOBAL *PROFILER_GLOBAL_create( void ) {
395395

396396
time( &rawtime );
397397
ptm = localtime( &rawtime );
398-
sprintf( fb_profiler->launch_time, "%02d-%02d-%04d, %02d:%02d:%02d", 1+ptm->tm_mon, ptm->tm_mday, 1900+ptm->tm_year, ptm->tm_hour, ptm->tm_min, ptm->tm_sec );
398+
snprintf( fb_profiler->launch_time, sizeof(fb_profiler->launch_time),
399+
"%02d-%02d-%04d, %02d:%02d:%02d",
400+
(int)(1+ptm->tm_mon), (int)(ptm->tm_mday), (int)(1900+ptm->tm_year),
401+
(int)ptm->tm_hour, (int)ptm->tm_min, (int)ptm->tm_sec );
402+
fb_profiler->launch_time[sizeof(fb_profiler->launch_time)-1] = '\0';
399403
}
400404
return fb_profiler;
401405
}

src/rtlib/profile_cycles.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#endif
1818

1919
/* profile section data */
20-
extern int __start_fb_profilecycledata;
21-
extern int __stop_fb_profilecycledata;
20+
extern char __start_fb_profilecycledata;
21+
extern char __stop_fb_profilecycledata;
2222

2323
/* profiler record ids - these indicate what the record is */
2424
enum FB_PROFILE_REDORD_ID

0 commit comments

Comments
 (0)