summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/buffer/buf_str.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2015-03-31 12:14:06 +0800
committerPeter Jones <pjones@redhat.com>2015-05-12 13:51:02 -0400
commit3285f5394161e2fde1045fd3f9753a625d03a1aa (patch)
treea3149decea22d31dfe81cc7054f55d65fc45f46a /Cryptlib/OpenSSL/crypto/buffer/buf_str.c
parentd7cbd4e3927ea272c709e3f0fd28d53fcc074c34 (diff)
downloadefi-boot-shim-3285f5394161e2fde1045fd3f9753a625d03a1aa.tar.gz
efi-boot-shim-3285f5394161e2fde1045fd3f9753a625d03a1aa.zip
Update Cryptlib and openssl
Update Cryptlib to r16559 and openssl to 0.9.8zf Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/buffer/buf_str.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/buffer/buf_str.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/Cryptlib/OpenSSL/crypto/buffer/buf_str.c b/Cryptlib/OpenSSL/crypto/buffer/buf_str.c
index 28dd1e40..88be76fc 100644
--- a/Cryptlib/OpenSSL/crypto/buffer/buf_str.c
+++ b/Cryptlib/OpenSSL/crypto/buffer/buf_str.c
@@ -7,7 +7,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -58,59 +58,59 @@
#include <openssl/buffer.h>
char *BUF_strdup(const char *str)
- {
- if (str == NULL) return(NULL);
- return BUF_strndup(str, strlen(str));
- }
+{
+ if (str == NULL)
+ return (NULL);
+ return BUF_strndup(str, strlen(str));
+}
char *BUF_strndup(const char *str, size_t siz)
- {
- char *ret;
+{
+ char *ret;
- if (str == NULL) return(NULL);
+ if (str == NULL)
+ return (NULL);
- ret=OPENSSL_malloc(siz+1);
- if (ret == NULL)
- {
- BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
- return(NULL);
- }
- BUF_strlcpy(ret,str,siz+1);
- return(ret);
- }
+ ret = OPENSSL_malloc(siz + 1);
+ if (ret == NULL) {
+ BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
+ return (NULL);
+ }
+ BUF_strlcpy(ret, str, siz + 1);
+ return (ret);
+}
void *BUF_memdup(const void *data, size_t siz)
- {
- void *ret;
+{
+ void *ret;
- if (data == NULL) return(NULL);
+ if (data == NULL)
+ return (NULL);
- ret=OPENSSL_malloc(siz);
- if (ret == NULL)
- {
- BUFerr(BUF_F_BUF_MEMDUP,ERR_R_MALLOC_FAILURE);
- return(NULL);
- }
- return memcpy(ret, data, siz);
- }
+ ret = OPENSSL_malloc(siz);
+ if (ret == NULL) {
+ BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE);
+ return (NULL);
+ }
+ return memcpy(ret, data, siz);
+}
size_t BUF_strlcpy(char *dst, const char *src, size_t size)
- {
- size_t l = 0;
- for(; size > 1 && *src; size--)
- {
- *dst++ = *src++;
- l++;
- }
- if (size)
- *dst = '\0';
- return l + strlen(src);
- }
+{
+ size_t l = 0;
+ for (; size > 1 && *src; size--) {
+ *dst++ = *src++;
+ l++;
+ }
+ if (size)
+ *dst = '\0';
+ return l + strlen(src);
+}
size_t BUF_strlcat(char *dst, const char *src, size_t size)
- {
- size_t l = 0;
- for(; size > 0 && *dst; size--, dst++)
- l++;
- return l + BUF_strlcpy(dst, src, size);
- }
+{
+ size_t l = 0;
+ for (; size > 0 && *dst; size--, dst++)
+ l++;
+ return l + BUF_strlcpy(dst, src, size);
+}