Skip to content

Commit

Permalink
Revert "Fix compile warnings"
Browse files Browse the repository at this point in the history
This reverts commit 5c9885d.
  • Loading branch information
damienstuart committed Jan 28, 2024
1 parent dee00ad commit e7fa0ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion client/getpasswd.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ get_key_file(char *key, int *key_len, const char *key_file,
fko_ctx_t ctx, const fko_cli_options_t *options)
{
FILE *pwfile_ptr;
unsigned int i = 0, found_dst;
unsigned int numLines = 0, i = 0, found_dst;

char conf_line_buf[MAX_LINE_LEN] = {0};
char tmp_char_buf[MAX_LINE_LEN] = {0};
Expand All @@ -234,6 +234,7 @@ get_key_file(char *key, int *key_len, const char *key_file,

while ((fgets(conf_line_buf, MAX_LINE_LEN, pwfile_ptr)) != NULL)
{
numLines++;
conf_line_buf[MAX_LINE_LEN-1] = '\0';
lptr = conf_line_buf;

Expand Down
6 changes: 4 additions & 2 deletions lib/fko_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ have_allow_ip(const char *msg)
{
const char *ndx = msg;
char ip_str[MAX_IPV4_STR_LEN];
int char_ctr = 0;
int dot_ctr = 0, char_ctr = 0;
int res = FKO_SUCCESS;

while(*ndx != ',' && *ndx != '\0')
Expand All @@ -48,7 +48,9 @@ have_allow_ip(const char *msg)
res = FKO_ERROR_INVALID_ALLOW_IP;
break;
}
if(isdigit((int)(unsigned char)*ndx) == 0)
if(*ndx == '.')
dot_ctr++;
else if(isdigit((int)(unsigned char)*ndx) == 0)
{
res = FKO_ERROR_INVALID_ALLOW_IP;
break;
Expand Down

0 comments on commit e7fa0ef

Please sign in to comment.