bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Re: ftp: command processing


From: Debarshi 'Rishi' Ray
Subject: [bug-inetutils] Re: ftp: command processing
Date: Wed, 15 Aug 2007 15:56:11 +0530

> Have you considered using getline instead of fgets?

In fact I had not, but now that I look I find:

1. According to the online manual page, getline is a GNU extension
available since libc 4.6.27. Since we will be mostly using it on
non-readline (possibly non-GNU too) systems, would it be a good idea
to use it instead of fgets which conforms to C89 and C99? Yes, we do
have gnulib, but even then.

2. getline resizes the buffer if it is insufficient to hold the data.
Currently in non-readline cases we read the data into a statically
allocated array, and trying to resize it will lead to problems.
Of-course we can change to using 'char *line' for non-readline cases
too, but that will require a number of changes all throughout the
code. Do we want to have those changes in this patch?

Happy hacking,
Debarshi
-- 
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]