ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Change the size of a mpg123_string

Returns:
0 on error, 1 on success

Definition at line 35 of file stringbuf.c.

Referenced by convert_latin1(), convert_utf16bom(), convert_utf8(), mpg123_copy_string(), mpg123_grow_string(), and store_id3_text().

{
    debug3("resizing string pointer %p from %lu to %lu", (void*) sb->p, (unsigned long)sb->size, (unsigned long)new);
    if(new == 0)
    {
        if(sb->size && sb->p != NULL) free(sb->p);
        mpg123_init_string(sb);
        return 1;
    }
    if(sb->size != new)
    {
        char* t;
        debug("really!");
        t = (char*) safe_realloc(sb->p, new*sizeof(char));
        debug1("safe_realloc returned %p", (void*) t); 
        if(t != NULL)
        {
            sb->p = t;
            sb->size = new;
            return 1;
        }
        else return 0;
    }
    else return 1; /* success */
}

Generated on Sat May 26 2012 06:11:37 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.