1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 22:45:03 -05:00

libtest/stub_gssapi: use "real" snprintf

... since it doesn't link with libcurl.

Reverts the commit dcd6f81025 changes from this file.

Bug: https://curl.haxx.se/mail/lib-2019-01/0000.html
Reported-by: Shlomi Fish
Reviewed-by: Daniel Gustafsson
Reviewed-by: Kamil Dudka

Closes #3434
This commit is contained in:
Daniel Stenberg 2019-01-03 12:00:58 +01:00
parent d42520f2c8
commit c7c362a24c
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 2017-2018, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 2017-2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -28,10 +28,7 @@
#include "stub_gssapi.h" #include "stub_gssapi.h"
#define ENABLE_CURLX_PRINTF /* !checksrc! disable SNPRINTF all */
/* make the curlx header define all printf() functions to use the curlx_*
versions instead */
#include "curlx.h" /* from the private lib dir */
#define MAX_CREDS_LENGTH 250 #define MAX_CREDS_LENGTH 250
#define APPROX_TOKEN_LEN 250 #define APPROX_TOKEN_LEN 250
@ -207,8 +204,10 @@ OM_uint32 gss_init_sec_context(OM_uint32 *min,
} }
/* Token format: creds:target:type:padding */ /* Token format: creds:target:type:padding */
used = msnprintf(token, length, "%s:%s:%d:", creds, /* Note: this is using the *real* snprintf() and not the curl provided
(char *) target_name, ctx->sent); one */
used = snprintf(token, length, "%s:%s:%d:", creds,
(char *) target_name, ctx->sent);
if(used >= length) { if(used >= length) {
free(token); free(token);