Skip to content

Commit

Permalink
fixed memory problem
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhartnett committed Oct 23, 2023
1 parent 2f5a86d commit 20f8d4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/g2cdegrib2.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ g2c_get_datetime(int ipdtn, long long int *ipdtmpl, short year, unsigned char mo
}

/* Determine second unit of time range. */
iutpos2 = ipos2[ipdtn - 1];
if (ipdtn > 0)
iutpos2 = ipos2[ipdtn - 1];
else
iutpos2 = 0;
switch (ipdtmpl[iutpos2])
{
case 0:
Expand Down

0 comments on commit 20f8d4a

Please sign in to comment.