guile-devel
[Top][All Lists]
Advanced

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

Re: bug with read-string!/partial


From: Han-Wen Nienhuys
Subject: Re: bug with read-string!/partial
Date: Mon, 22 Aug 2005 23:17:00 +0200
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

Han-Wen Nienhuys wrote:

Hi,

what's the proper way to use read-string!/partial ?

If I read a file with fewer bytes than the arg of read-string!/partial,
I get problems down the line, when

  char *
  scm_to_locale_stringn (SCM str, size_t *lenp)

checks whether

 memcpy (res, scm_i_string_chars (str), len);
  if (lenp == NULL)
    {
      res[len] = '\0';
      if (strlen (res) != len)
    {
      free (res);
      scm_misc_error (NULL,
              "string contains #\\nul character: ~S",
              scm_list_1 (str));
    }
    }

In addition, I this error message isn't printed properly, but I get

  Converting to PNG...throw from within critical section.
  Geannuleerd
  muurbloem:~/src/lilypond$



additional information: this comes from regex-posix.c

  c_str = scm_to_locale_string (substr);
  status = regexec (SCM_RGX (rx), c_str, nmatches, matches,
                    scm_to_int (flags));
  free (c_str);

why is this using null-delimited strings?


--
 Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen




reply via email to

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