Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Fixed issue #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewerr committed Dec 31, 2017
1 parent 332473b commit c03979d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#include "util.h"
#include "message.h"
#include <stdio.h>
int randport()
{
Expand Down Expand Up @@ -38,8 +39,10 @@ const char* getarg(const char arg[2], const char* argv[], int argc)
#endif
if (!strcmp(arg, argv[i])) {

if (i < argc) {
if (i < argc-1) {
return argv[i + 1];
}else{
die("Argument required for key:%s",arg);
}
}
}
Expand All @@ -54,8 +57,10 @@ const char* getlarg(const char* arg, const char* argv[], int argc)
#endif
if (!strcmp(arg, argv[i])) {

if (i < argc) {
if (i < argc-1) {
return argv[i + 1];
}else{
die("Argument required for key:%s",arg);
}
}
}
Expand Down

0 comments on commit c03979d

Please sign in to comment.