[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] [Patch] More bullet-proof drive detection for GNU/Li

From: Burkhard Plaum
Subject: Re: [Libcdio-devel] [Patch] More bullet-proof drive detection for GNU/Linux
Date: Tue, 28 Nov 2006 17:01:35 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1

R. Bernstein wrote:
First, thanks for changing those strcpy's to strncpy.

Am I missing something or would "PATH_MAX" better be "len" below?
    else {
      tmp_dst[len] = '\0';
      strncpy(tmp_src, tmp_dst, PATH_MAX);

It's because (according to manpage) readlink adds no
'\0' to the string and instead returns the length (len in this case).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]