* Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>\r
* All rights reserved.\r
*\r
- * Copyright (c) 2015, Hewlett Packard Enterprise Development, L.P.<BR>\r
+ * (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
*\r
* Redistribution and use in source and binary forms, with or without\r
* modification, are permitted provided that the following conditions\r
\r
static void sprint_byte(char* s, unsigned int v)\r
{\r
- sprintf(s, "%02x", (v & 0377));\r
+ sprintf_s(s, sizeof("00"), "%02x", (v & 0377));\r
}\r
\r
static void sprint_byte_with_x(char* s, unsigned int v)\r
{\r
- sprintf(s, "\\x%02x", (v & 0377));\r
+ sprintf_s(s, sizeof("\\x00"), "\\x%02x", (v & 0377));\r
}\r
\r
static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,\r
#define MAX_ERROR_PAR_LEN 30\r
\r
extern int\r
+EFIAPI\r
#ifdef HAVE_STDARG_PROTOTYPES\r
onig_error_code_to_str(UChar* s, int code, ...)\r
#else\r
\r
default:\r
q = onig_error_code_to_format(code);\r
+ if (q == NULL) {\r
+ len = 0;\r
+ break;\r
+ }\r
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, q);\r
xmemcpy(s, q, len);\r
s[len] = '\0';\r
\r
\r
void\r
+EFIAPI\r
#ifdef HAVE_STDARG_PROTOTYPES\r
onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,\r
UChar* pat, UChar* pat_end, const UChar *fmt, ...)\r