Re: Notes when applying IO channel patch
- From: Havoc Pennington <hp redhat com>
- To: Owen Taylor <otaylor redhat com>
- Cc: Tim Janik <timj gtk org>, Ron Steinke <rsteinke w-link net>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Notes when applying IO channel patch
- Date: 30 Jun 2001 20:18:11 -0400
Owen Taylor <otaylor redhat com> writes:
> The way I'd expect it to be used would be somthing like:
>
> gsize old_len = str->len;
> g_string_set_length (string, str->allocated_len - 1);
> count = read (string, buffer, buffer->str + old_len, buffer->len - old_len);
> g_string_set_length (string, old_len + count);
>
That seems OK to me.
> count = read (string, buffer, buffer->str + buffer->len,
> buffer->allocated_len - old_len - 1);
> g_string_set_length (string, buffer->len + count);
>
This is what I was worried about - I'd almost want to add code to make
sure it doesn't work, I think it's a bit evil.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]