view mp_strings.c @ 36689:e8567b5f7da9

Change help message texts corresponding with r36766. In r36766 some messages of the English master file have been merged. Make these changes wherever these messages still differ in a translation. Changes are: MSGTR_MENU_AudioLanguages now same as MSGTR_MENU_AudioTrack MSGTR_MENU_LoadSubtitle now same as MSGTR_PREFERENCES_FRAME_Subtitle MSGTR_MENU_PlayCD now same as MSGTR_MENU_CD MSGTR_MENU_PlayDVD now same as MSGTR_MENU_DVD MSGTR_MENU_PlayDisc now same as MSGTR_MENU_Play MSGTR_MENU_PlayVCD now same as MSGTR_MENU_VCD MSGTR_MENU_SubtitleLanguages now same as MSGTR_MENU_Subtitles MSGTR_PREFERENCES_FPS now same as MSGTR_PREFERENCES_SUB_FPS MSGTR_PREFERENCES_Font now same as MSGTR_PREFERENCES_FRAME_Font MSGTR_PREFERENCES_None now same as MSGTR_MENU_None MSGTR_PREFERENCES_Subtitle now same as MSGTR_PREFERENCES_FRAME_Subtitle MSGTR_SkinBrowser now same as MSGTR_MENU_SkinBrowser
author ib
date Tue, 04 Feb 2014 18:29:10 +0000
parents 2ef9298a81e7
children
line wrap: on
line source

/*
 * Strings utilities
 *
 * This file is part of MPlayer.
 *
 * MPlayer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MPlayer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>

#include "mp_strings.h"

char *mp_asprintf(const char *fmt, ...)
{
    char *p = NULL;
    va_list va;
    int len;

    va_start(va, fmt);
    len = vsnprintf(NULL, 0, fmt, va);
    va_end(va);
    if (len < 0)
        goto end;

    p = malloc(len + 1);
    if (!p)
        goto end;

    va_start(va, fmt);
    len = vsnprintf(p, len + 1, fmt, va);
    va_end(va);
    if (len < 0)
        free(p), p = NULL;

end:
    return p;
}