LKML Archive on
help / color / mirror / Atom feed
From: Roel Kluin <>
Cc: Linux-arm <>,
	lkml <>
Subject: [PATCH] locomo.c: convert strncpy(x, y, sizeof(x)) to strlcpy
Date: Thu, 06 Mar 2008 14:08:27 +0100	[thread overview]
Message-ID: <> (raw)

This patch was not yet tested. Please confirm it's right.
strncpy does not append '\0' if the length of the source string equals
the size parameter, strlcpy does.

Signed-off-by: Roel Kluin <>
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index ae21755..89b2328 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -516,7 +516,7 @@ locomo_init_one_child(struct locomo *lchip, struct locomo_dev_info *info)
 		goto out;
-	strncpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
+	strlcpy(dev->dev.bus_id, info->name, sizeof(dev->dev.bus_id));
 	 * If the parent device has a DMA mask associated with it,
 	 * propagate it down to the children.

             reply	other threads:[~2008-03-06 13:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 13:08 Roel Kluin [this message]
2008-03-06 21:44 ` H. Peter Anvin
2008-03-06 23:35   ` Roel Kluin
2008-03-07  1:51     ` David Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] locomo.c: convert strncpy(x, y, sizeof(x)) to strlcpy' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).