mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
pointerless backing buffers for string ports
* libguile/strports.c (scm_mkstrport): String port string buffer allocated atomically.
This commit is contained in:
parent
b2548e2344
commit
574b7be0ba
1 changed files with 2 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
|
/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002, 2003, 2005, 2006, 2009, 2010, 2011 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public License
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
@ -314,7 +314,7 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
|
||||||
/* Create a copy of STR in the encoding of Z. */
|
/* Create a copy of STR in the encoding of Z. */
|
||||||
buf = scm_to_stringn (str, &str_len, pt->encoding,
|
buf = scm_to_stringn (str, &str_len, pt->encoding,
|
||||||
SCM_FAILED_CONVERSION_ERROR);
|
SCM_FAILED_CONVERSION_ERROR);
|
||||||
c_str = scm_gc_malloc (str_len, "strport");
|
c_str = scm_gc_malloc_pointerless (str_len, "strport");
|
||||||
memcpy (c_str, buf, str_len);
|
memcpy (c_str, buf, str_len);
|
||||||
free (buf);
|
free (buf);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue