bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Return value of fgets ignored in lib_file _io. (Was: Re: i


From: Elias Mårtenson
Subject: Re: [Bug-apl] Return value of fgets ignored in lib_file _io. (Was: Re: is there a )copy ⎕fns lik e ⎕ex is )erase)
Date: Sat, 26 Apr 2014 23:00:19 +0800

I created that channel. And I'm idling in there. :-)

Regards,
Elias


On 26 April 2014 22:41, <address@hidden> wrote:

Fantastic/wow - you found the bug that fast?  What a bunch of great programmers we have behind this grand apl. The whole project has become quite amazing.

If there is anything I can ever help you debug let me know ... I am great at ⍳100 ;)

btw - There is an #apl channel on freenode that has a few non-talking people in it

enztec

On Sat, 26 Apr 2014 15:43:31 +0200
Kacper Gutowski <address@hidden> wrote:

> On 2014-04-26 07:13:21, address@hidden wrote:
> > btw if you can take a look at the FILE_IO code in http://lists.gnu.org/archive/html/bug-apl/2014-04/msg00269.html
> > and give me an idea why the difference between c popen and apl popen - null vs no '10' at end of data still returned - i'd appreciate it
>
> The difference is that there is a bug in lib_file_io.
> When FILE_IO[8] is called dyadically, return value of fgets(3) is silently ignored and garbage is returned.
>
> -k
>
>
>
> Index: src/native/file_io.cc
> ===================================================================
> --- src/native/file_io.cc (revision 224)
> +++ src/native/file_io.cc (working copy)
> @@ -796,7 +796,7 @@
>                     buffer = del = new char[bytes + 1];
>
>                  const char * s = fgets(buffer, bytes, fe.fe_file);
> -                const int len = strlen(buffer);
> +                const int len = s ? strlen(s) : 0;
>                  Value_P Z(new Value(len, LOC));
>                  new (&Z->get_ravel(0)) IntCell(0);   // prototype
>                  loop(z, len)   new (&Z->get_ravel(z)) IntCell(buffer[z] & 0xFF);
>
>



reply via email to

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