ca-scripts icon indicating copy to clipboard operation
ca-scripts copied to clipboard

Fixed calculation error caused by invalid octal number

Open yuuki0xff opened this issue 5 years ago • 2 comments

"%j" format of GNU date command will be replaced a zero-padded 3 digit number. When day-of-year < 100, leading character of NOWDAYS or ENDDAYS is '0' and bash interprets two variables as octal.

$ TZ= date +%j -d 2019-03-30
089
$ echo $(( 089 ))
bash: 089: value too great for base (error token is "089")

yuuki0xff avatar Mar 30 '19 14:03 yuuki0xff

Just got bit by this: Apparently everyone renews their certificates mid-to-late in the year?

D3-jwatts avatar Apr 05 '20 00:04 D3-jwatts

@fluffle Please merge it.

yuuki0xff avatar Jan 03 '24 12:01 yuuki0xff