Skip to content

Commit b5cd96f

Browse files
authored
removes annoying warning
``` [ 31%] Building CXX object numgrid/CMakeFiles/numgrid-objects.dir/lebedev/sphere_lebedev_rule.cpp.o /home/scemama/Downloads/numgrid/numgrid/lebedev/sphere_lebedev_rule.cpp: In function ‘void timestamp()’: /home/scemama/Downloads/numgrid/numgrid/lebedev/sphere_lebedev_rule.cpp:6483:10: warning: variable ‘len’ set but not used [-Wunused-but-set-variable] size_t len; ^~~ ```
1 parent 17f5710 commit b5cd96f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

numgrid/lebedev/sphere_lebedev_rule.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6487,6 +6487,14 @@ void timestamp ( void )
64876487
tm = localtime ( &now );
64886488

64896489
len = strftime ( time_buffer, TIME_SIZE, "%d %B %Y %I:%M:%S %p", tm );
6490+
if (len == 0)
6491+
{
6492+
fprintf ( stderr, "\n" );
6493+
fprintf ( stderr, "TIMESTAMP - Fatal error!\n" );
6494+
fprintf ( stderr, " TIME_SIZE constant too small.\n" );
6495+
exit ( 1 );
6496+
}
6497+
64906498

64916499
fprintf ( stdout, "%s\n", time_buffer );
64926500

0 commit comments

Comments
 (0)