pike.git / src / modules / _Stdio / buffer.cmod

version» Context lines:

pike.git/src/modules/_Stdio/buffer.cmod:901:    *! filedescriptor unless it's set to be non-blocking.    */    PIKEFUN int(-1..) input_from( object f, int|void _nbytes, int|void _once )    {    Buffer *io = THIS;    size_t sz = io_len( io );    size_t bread = 0, nbytes = (size_t)-1;    struct my_file *fd;    int once = 0;    -  if( _nbytes ) { +  if( _nbytes && (SUBTYPEOF(*_nbytes) == NUMBER_NUMBER) ) {    nbytes = _nbytes->u.integer;    if (!nbytes) RETURN 0;    }       if( _once )    once = _once->u.integer;          if( (fd = get_storage( f, file_program )) )    {
pike.git/src/modules/_Stdio/buffer.cmod:1027:    Buffer *io = THIS;    ptrdiff_t written = 0;    ptrdiff_t sz = io_len( io );    int write_fun_num = -1;       if( !sz )    {    io_range_error(io, sz);    sz = io_len(io);    } -  if( nbytes ) +  if( nbytes && (SUBTYPEOF(*nbytes) == NUMBER_NUMBER) )    sz = MINIMUM(nbytes->u.integer, sz);       if( TYPEOF(*f) == PIKE_T_OBJECT ) {    struct program *p = f->u.object->prog;    if (LIKELY(p)) {    struct inherit *inh = p->inherits + SUBTYPEOF(*f);    p = inh->prog;    if ((write_fun_num = find_identifier("write", p)) == -1) {    Pike_error("Function \"write\" not available in object.\n");    }