mariadb/storage/connect/rcmsg.c
Olivier Bertrand b9165cb58d - Remove gcc warning (no previous declaration of msglang)
modified:
  storage/connect/ha_connect.cc

- Define strcasecmp for Linux
modified:
  storage/connect/rcmsg.c

- Avoid potential buffer overflow
modified:
  storage/connect/plgdbutl.cpp
  
- Change %d in %lld in VALUE_TOO_BIG message
modified:
  storage/connect/encas.h
  storage/connect/english.msg
  storage/connect/frcas.h
  storage/connect/french.msg
  storage/connect/frmsg.h
2014-11-16 01:16:51 +01:00

65 lines
1.9 KiB
C

/**************** RCMsg C Program Source Code File (.C) ****************/
/* PROGRAM NAME: RCMSG */
/* ------------- */
/* Version 1.3 */
/* */
/* COPYRIGHT */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND: 2005 - 2014 */
/* */
/* WHAT THIS PROGRAM DOES */
/* ----------------------- */
/* This program simulates LoadString. */
/* */
/***********************************************************************/
#if !defined(XMSG)
#include <stdio.h>
#include <string.h>
#include "resource.h"
#include "rcmsg.h"
#if defined(NEWMSG)
#include "msgid.h"
#endif // NEWMSG
#if !defined(WIN32)
#define stricmp strcasecmp
#endif // !WIN32
char *msglang(void);
char *GetMsgid(int id)
{
char *p = NULL;
if (!stricmp(msglang(), "french"))
switch (id) {
#include "frids.h"
#if defined(NEWMSG)
#include "frcas.h"
#endif // NEWMSG
} // endswitch(id)
else // English
switch (id) {
#include "enids.h"
#if defined(NEWMSG)
#include "encas.h"
#endif // NEWMSG
} // endswitch(id)
return p;
} // end of GetMsgid
int GetRcString(int id, char *buf, int bufsize)
{
char *p = NULL, msg[32];
if (!(p = GetMsgid(id))) {
sprintf(msg, "ID=%d unknown", id);
p = msg;
} // endif p
return sprintf(buf, "%.*s", bufsize-1, p);
} // end of GetRcString
#endif // !XMSG