[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] [PATCH] Fix compiler warnings
From: |
Giuseppe Scrivano |
Subject: |
Re: [bug-inetutils] [PATCH] Fix compiler warnings |
Date: |
Thu, 03 Dec 2009 21:33:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Guillem Jover <address@hidden> writes:
>> diff --git a/inetd/inetd.c b/inetd/inetd.c
>> index f2c1e3b..072702b 100644
>> --- a/inetd/inetd.c
>> +++ b/inetd/inetd.c
>> @@ -1013,7 +1011,7 @@ getconfigent (FILE *fconfig, const char *file, size_t
>> *line)
>> {
>> static struct servtab serv;
>> struct servtab *sep = &serv;
>> - size_t argc = 0, i;
>> + int argc = 0, i;
>> char **argv = NULL;
>> char *node, *service;
>> static char TCPMUX_TOKEN[] = "tcpmux/";
>
> This was not documented in the ChangeLog. And it seems to me only āiā
> needs to be size_t, and argc would be better left as int to match
> normal argc/argv types.
in my patch I changed both to be int.
I have reverted half of it, now only argc is int; later in the function
`i' is compared to a size_t so the original type is the correct one.
FYI, I have just pushed the following patch.
Giuseppe
>From 927b07be123a87d7d944a02fe56529f0873a072f Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <address@hidden>
Date: Thu, 3 Dec 2009 21:24:30 +0100
Subject: [PATCH] Fix ChangeLog entry.
---
ChangeLog | 1 +
inetd/inetd.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3816557..a1c35b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
(get_name): Remove unused variable.
* ifconfig/system/linux.c (system_fh_hwaddr): Add cast.
* inetd/inetd.c (expand_enter): Remove unused variables.
+ (getconfigent): Change type of `argc' to int.
* libinetutils/tftpsubs.c (synchnet): Change the `fromlen' type to
socklen_t.
* libinetutils/ttymsg.c (normalize_path): Use parentheses around
diff --git a/inetd/inetd.c b/inetd/inetd.c
index 07629de..88da205 100644
--- a/inetd/inetd.c
+++ b/inetd/inetd.c
@@ -1015,7 +1015,8 @@ getconfigent (FILE *fconfig, const char *file, size_t
*line)
{
static struct servtab serv;
struct servtab *sep = &serv;
- int argc = 0, i;
+ int argc = 0;
+ size_t i;
char **argv = NULL;
char *node, *service;
static char TCPMUX_TOKEN[] = "tcpmux/";
--
1.6.5