pike.git
/
src
/
post_modules
/
Shuffler
/
a_source_pikestring.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Shuffler/a_source_pikestring.c:53:
} struct source *source_pikestring_make( struct svalue *s, INT64 start, INT64 len ) { struct ps_source *res; if( TYPEOF(*s) != PIKE_T_STRING ) return 0; if( s->u.string->size_shift ) return 0;
-
res =
malloc
( sizeof( struct ps_source ) );
+
res =
calloc
(
1,
sizeof( struct ps_source ) );
+
if( !res ) retrun NULL;
debug_malloc_touch( res ); debug_malloc_touch( s );
-
MEMSET( res, 0, sizeof( struct ps_source ) );
+
res->s.free_source = free_source; res->s.get_data = get_data; copy_shared_string(res->str, s->u.string); res->offset = start; if( len != -1 ) { if( len > res->str->len-start )