[libsoup] Replace strncpy with g_strlcpy
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Replace strncpy with g_strlcpy
- Date: Mon, 20 Sep 2021 20:45:16 +0000 (UTC)
commit d70e455be01df7816dadcf48138db84cbfd010cd
Author: Patrick Griffis <pgriffis igalia com>
Date: Mon Sep 20 15:40:11 2021 -0500
Replace strncpy with g_strlcpy
libsoup/auth/soup-auth-digest.c | 4 ++--
libsoup/http1/soup-body-output-stream.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libsoup/auth/soup-auth-digest.c b/libsoup/auth/soup-auth-digest.c
index eab0f377..13b6cc16 100644
--- a/libsoup/auth/soup-auth-digest.c
+++ b/libsoup/auth/soup-auth-digest.c
@@ -248,7 +248,7 @@ soup_auth_digest_compute_hex_urp (const char *username,
g_checksum_update (checksum, (guchar *)realm, strlen (realm));
g_checksum_update (checksum, (guchar *)":", 1);
g_checksum_update (checksum, (guchar *)password, strlen (password));
- strncpy (hex_urp, g_checksum_get_string (checksum), 33);
+ g_strlcpy (hex_urp, g_checksum_get_string (checksum), 33);
g_checksum_free (checksum);
}
@@ -278,7 +278,7 @@ soup_auth_digest_compute_hex_a1 (const char *hex_urp,
g_checksum_update (checksum, (guchar *)nonce, strlen (nonce));
g_checksum_update (checksum, (guchar *)":", 1);
g_checksum_update (checksum, (guchar *)cnonce, strlen (cnonce));
- strncpy (hex_a1, g_checksum_get_string (checksum), 33);
+ g_strlcpy (hex_a1, g_checksum_get_string (checksum), 33);
g_checksum_free (checksum);
}
}
diff --git a/libsoup/http1/soup-body-output-stream.c b/libsoup/http1/soup-body-output-stream.c
index 6f5c7806..3cbd770b 100644
--- a/libsoup/http1/soup-body-output-stream.c
+++ b/libsoup/http1/soup-body-output-stream.c
@@ -224,12 +224,12 @@ again:
break;
case SOUP_BODY_OUTPUT_STREAM_STATE_CHUNK_END:
- strncpy (buf, "\r\n", sizeof (priv->buf));
+ g_strlcpy (buf, "\r\n", sizeof (priv->buf));
priv->chunked_state = SOUP_BODY_OUTPUT_STREAM_STATE_DONE;
break;
case SOUP_BODY_OUTPUT_STREAM_STATE_TRAILERS:
- strncpy (buf, "\r\n", sizeof (priv->buf));
+ g_strlcpy (buf, "\r\n", sizeof (priv->buf));
priv->chunked_state = SOUP_BODY_OUTPUT_STREAM_STATE_DONE;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]