diff options
-rw-r--r-- | plugins/MirOTR/Libgcrypt/cipher/ecc.c | 4 | ||||
-rw-r--r-- | plugins/MirOTR/Libgcrypt/cipher/md.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/Libgcrypt/cipher/pubkey.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/Libgcrypt/mpi/ec.c | 4 | ||||
-rw-r--r-- | plugins/MirOTR/Libgcrypt/random/rndw32.c | 5 | ||||
-rw-r--r-- | plugins/MirOTR/Libgcrypt/src/misc.c | 2 | ||||
-rw-r--r-- | plugins/MirOTR/Libgpg-error/strerror.c | 32 |
7 files changed, 25 insertions, 26 deletions
diff --git a/plugins/MirOTR/Libgcrypt/cipher/ecc.c b/plugins/MirOTR/Libgcrypt/cipher/ecc.c index 885ff096ba..d2d490eb0a 100644 --- a/plugins/MirOTR/Libgcrypt/cipher/ecc.c +++ b/plugins/MirOTR/Libgcrypt/cipher/ecc.c @@ -1574,7 +1574,7 @@ compute_keygrip (gcry_md_hd_t md, gcry_sexp_t keyparms) raw = mpi_get_opaque (values[idx], &n); n = (n + 7)/8; - snprintf (buf, sizeof buf, "(1:%c%u:", names[idx], n); + _snprintf (buf, sizeof buf, "(1:%c%u:", names[idx], n); _gcry_md_write (md, buf, strlen (buf)); _gcry_md_write (md, raw, n); _gcry_md_write (md, ")", 1); @@ -1590,7 +1590,7 @@ compute_keygrip (gcry_md_hd_t md, gcry_sexp_t keyparms) rc = gpg_err_code_from_syserror (); goto leave; } - snprintf (buf, sizeof buf, "(1:%c%u:", names[idx], rawmpilen); + _snprintf (buf, sizeof buf, "(1:%c%u:", names[idx], rawmpilen); _gcry_md_write (md, buf, strlen (buf)); _gcry_md_write (md, rawmpi, rawmpilen); _gcry_md_write (md, ")", 1); diff --git a/plugins/MirOTR/Libgcrypt/cipher/md.c b/plugins/MirOTR/Libgcrypt/cipher/md.c index 20b652e03b..c9f0ab3f33 100644 --- a/plugins/MirOTR/Libgcrypt/cipher/md.c +++ b/plugins/MirOTR/Libgcrypt/cipher/md.c @@ -1121,7 +1121,7 @@ md_start_debug ( gcry_md_hd_t md, const char *suffix ) return; } idx++; - snprintf (buf, DIM(buf)-1, "dbgmd-%05d.%.10s", idx, suffix ); + _snprintf (buf, DIM(buf)-1, "dbgmd-%05d.%.10s", idx, suffix ); md->ctx->debug = fopen(buf, "w"); if ( !md->ctx->debug ) log_debug("md debug: can't open %s\n", buf ); diff --git a/plugins/MirOTR/Libgcrypt/cipher/pubkey.c b/plugins/MirOTR/Libgcrypt/cipher/pubkey.c index d8f5f5d0ea..147f82aa7d 100644 --- a/plugins/MirOTR/Libgcrypt/cipher/pubkey.c +++ b/plugins/MirOTR/Libgcrypt/cipher/pubkey.c @@ -689,7 +689,7 @@ _gcry_pk_get_keygrip (gcry_sexp_t key, unsigned char *array) if (! data) goto fail; - snprintf (buf, sizeof buf, "(1:%c%u:", *s, (unsigned int)datalen); + _snprintf (buf, sizeof buf, "(1:%c%u:", *s, (unsigned int)datalen); _gcry_md_write (md, buf, strlen (buf)); _gcry_md_write (md, data, datalen); sexp_release (l2); diff --git a/plugins/MirOTR/Libgcrypt/mpi/ec.c b/plugins/MirOTR/Libgcrypt/mpi/ec.c index 168076f4bd..8222366a0c 100644 --- a/plugins/MirOTR/Libgcrypt/mpi/ec.c +++ b/plugins/MirOTR/Libgcrypt/mpi/ec.c @@ -45,11 +45,11 @@ _gcry_mpi_point_log (const char *name, mpi_point_t point, mpi_ec_t ctx) if (!point) { - snprintf (buf, sizeof buf - 1, "%s.*", name); + _snprintf (buf, sizeof buf - 1, "%s.*", name); log_mpidump (buf, NULL); return; } - snprintf (buf, sizeof buf - 1, "%s.X", name); + _snprintf (buf, sizeof buf - 1, "%s.X", name); if (ctx) { diff --git a/plugins/MirOTR/Libgcrypt/random/rndw32.c b/plugins/MirOTR/Libgcrypt/random/rndw32.c index 71cca0364c..f1a4105762 100644 --- a/plugins/MirOTR/Libgcrypt/random/rndw32.c +++ b/plugins/MirOTR/Libgcrypt/random/rndw32.c @@ -513,7 +513,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), status = RegQueryValueEx (hKey, "ProductType", 0, NULL, szValue, &dwSize); - if (status == ERROR_SUCCESS && stricmp (szValue, "WinNT")) + if (status == ERROR_SUCCESS && _stricmp(szValue, "WinNT")) { /* Note: There are (at least) three cases for ProductType: WinNT = NT Workstation, ServerNT = NT Server, LanmanNT = @@ -602,8 +602,7 @@ slow_gatherer ( void (*add)(const void*, size_t, enum random_origins), char szDevice[50]; /* Check whether we can access this device. */ - snprintf (szDevice, sizeof szDevice, "\\\\.\\PhysicalDrive%d", - drive_no); + _snprintf(szDevice, sizeof szDevice, "\\\\.\\PhysicalDrive%d", drive_no); hDevice = CreateFile (szDevice, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (hDevice == INVALID_HANDLE_VALUE) diff --git a/plugins/MirOTR/Libgcrypt/src/misc.c b/plugins/MirOTR/Libgcrypt/src/misc.c index b3c56e29bf..603693f825 100644 --- a/plugins/MirOTR/Libgcrypt/src/misc.c +++ b/plugins/MirOTR/Libgcrypt/src/misc.c @@ -341,7 +341,7 @@ _gcry_log_printmpi (const char *text, gcry_mpi_t mpi) char prefix[30]; p = mpi_get_opaque (mpi, &nbits); - snprintf (prefix, sizeof prefix, " [%u bit]", nbits); + _snprintf (prefix, sizeof prefix, " [%u bit]", nbits); do_printhex (text? text:" ", prefix, p, (nbits+7)/8); } else diff --git a/plugins/MirOTR/Libgpg-error/strerror.c b/plugins/MirOTR/Libgpg-error/strerror.c index b0efb3de4b..4013e7ae26 100644 --- a/plugins/MirOTR/Libgpg-error/strerror.c +++ b/plugins/MirOTR/Libgpg-error/strerror.c @@ -103,25 +103,25 @@ system_strerror_r (int no, char *buf, size_t buflen) already thread-safe. */ static int -system_strerror_r (int no, char *buf, size_t buflen) +system_strerror_r(int no, char *buf, size_t buflen) { - char *errstr = strerror (no); + char *errstr = strerror(no); - if (!errstr) - { - int saved_errno = errno; + if (!errstr) + { + int saved_errno = errno; - if (saved_errno != EINVAL) - snprintf (buf, buflen, "strerror failed: %i\n", errno); - return saved_errno; - } - else - { - size_t errstr_len = strlen (errstr) + 1; - size_t cpy_len = errstr_len < buflen ? errstr_len : buflen; - memcpy (buf, errstr, cpy_len); - return cpy_len == errstr_len ? 0 : ERANGE; - } + if (saved_errno != EINVAL) + _snprintf(buf, buflen, "strerror failed: %i\n", errno); + return saved_errno; + } + else + { + size_t errstr_len = strlen(errstr) + 1; + size_t cpy_len = errstr_len < buflen ? errstr_len : buflen; + memcpy(buf, errstr, cpy_len); + return cpy_len == errstr_len ? 0 : ERANGE; + } } #endif |