Skip to content

Commit

Permalink
V code: Use predefined argc, not argv.length
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuran committed Mar 19, 2018
1 parent a370a3a commit 32c7c9b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion v/bin/make-icns.vx
Expand Up @@ -144,7 +144,7 @@ def pack_icon_file
return pack_one( icon_type => data )
}

if const icons = argv[ 1 -> argv.length ] map pack_icon_file then
if const icons = argv[ 1 -> argc ] map pack_icon_file then
{
OUT <== pack_one( icns: icons )

Expand Down
2 changes: 1 addition & 1 deletion v/bin/sha256sum-parallel.vx
@@ -1,6 +1,6 @@
#!/usr/bin/env vx

const args = argv[ 1 -> argv.length ]
const args = argv[ 1 -> argc ]

const results = channel()

Expand Down
2 changes: 1 addition & 1 deletion v/bin/tcpcat.vx
@@ -1,6 +1,6 @@
#!/usr/bin/env vx -Z

if argv.length < 3 then
if argc < 3 then
{
warn "Usage: tcpcat <host> <port>"
exit 2
Expand Down
2 changes: 1 addition & 1 deletion v/examples/rot13.vx
@@ -1,6 +1,6 @@
#!/usr/bin/env vx

const args = argv[ 1 -> argv.length ]
const args = argv[ 1 -> argc ]

var text = join( " ", *args )

Expand Down

0 comments on commit 32c7c9b

Please sign in to comment.