Skip to content

Commit

Permalink
Update changelog and fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola committed Mar 6, 2020
1 parent 871bf89 commit ffb2ab7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions nasl/nasl_isotime.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ epoch2isotime (my_isotime_t timebuf, time_t atime)
tp = gmtime (&atime);
if (snprintf (timebuf, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d",
1900 + tp->tm_year, tp->tm_mon + 1, tp->tm_mday,
tp->tm_hour, tp->tm_min, tp->tm_sec) < 0)
tp->tm_hour, tp->tm_min, tp->tm_sec)
< 0)
{
*timebuf = '\0';
return;
Expand Down Expand Up @@ -437,8 +438,9 @@ add_seconds_to_isotime (my_isotime_t atime, int nseconds)
if (year > 9999 || month > 12 || day > 31 || year < 0 || month < 1 || day < 1)
return 1;

if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d",
year, month, day, hour, minute, sec) < 0)
if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d", year, month,
day, hour, minute, sec)
< 0)
return 1;

return 0;
Expand Down Expand Up @@ -475,8 +477,9 @@ add_days_to_isotime (my_isotime_t atime, int ndays)
if (year > 9999 || month > 12 || day > 31 || year < 0 || month < 1 || day < 1)
return 1;

if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d",
year, month, day, hour, minute, sec) < 0)
if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d", year, month,
day, hour, minute, sec)
< 0)
return 1;
return 0;
}
Expand Down Expand Up @@ -512,8 +515,9 @@ add_years_to_isotime (my_isotime_t atime, int nyears)
if (year > 9999 || month > 12 || day > 31 || year < 0 || month < 1 || day < 1)
return 1;

if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d",
year, month, day, hour, minute, sec) < 0)
if (snprintf (atime, ISOTIME_SIZE, "%04d%02d%02dT%02d%02d%02d", year, month,
day, hour, minute, sec)
< 0)
return 1;

return 0;
Expand Down

0 comments on commit ffb2ab7

Please sign in to comment.