summaryrefslogtreecommitdiff
path: root/unixtime.pl
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2017-07-12 15:21:31 +0100
committerJoe Robinson <joe@lc8n.com>2017-07-12 15:21:31 +0100
commitdcb2720df0a410bdef8714ef983a8d860009c969 (patch)
tree1a1aecb556d1ffe31d1cbe57209b14127eea6746 /unixtime.pl
parent955b122dd5ec7560d5b76c6095f024bf9e26560f (diff)
Handle argument being an empty string in the same way as undefined
Diffstat (limited to 'unixtime.pl')
-rwxr-xr-xunixtime.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/unixtime.pl b/unixtime.pl
index f47cf9f..ca99311 100755
--- a/unixtime.pl
+++ b/unixtime.pl
@@ -2,7 +2,7 @@
use POSIX qw( strftime );
use Time::HiRes qw( gettimeofday );
-if (defined $ARGV[0]) {
+if (defined $ARGV[0] and $ARGV ne "") {
if ($ARGV[1] eq "ms") {
#Convert from timestamp in milliseconds to date
$seconds = substr $ARGV[0], 0, 10;