On 09/09/2013 10:04 AM, William Roberts wrote:
>     +    while (fgets(line, sizeof(line), rules)) {
>     +        SLOGE(line);
>     +        if (line[0] != '-')
>     +            continue;
> 
> What if the line is bigger then what fgets got? Shouldn't we be growing
> a buffer based on newline? 

I believe that as of 4.3, bionic has getline(), so you can use that
instead.  Upstream libselinux uses getline() extensively; we had
switched our port of it over to using fgets() for Android since at that
time, bionic did not support getline(), but I guess we could look at
switching back now.



--
This message was distributed to subscribers of the seandroid-list mailing list.
If you no longer wish to subscribe, send mail to majord...@tycho.nsa.gov with
the words "unsubscribe seandroid-list" without quotes as the message.

Reply via email to