Gautham Banasandra created HDFS-15935:
-----------------------------------------

             Summary: Use memcpy for copying non-null terminated string
                 Key: HDFS-15935
                 URL: https://issues.apache.org/jira/browse/HDFS-15935
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: libhdfs++
    Affects Versions: 3.4.0
            Reporter: Gautham Banasandra
            Assignee: Gautham Banasandra


We currently get a warning while compiling HDFS native client -
{code}
[WARNING] /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: 
warning: '__builtin_strncpy' output truncated before terminating nul copying as 
many bytes from a string as its length [-Wstringop-truncation]
{code}

The scenario here is such that the copied string is deliberately not null 
terminated, so that we append a custom character appropriately. The warning 
reported by strncpy is valid, but not applicable in this scenario. Thus, we 
need to use memcpy which doesn't mind if the string is null terminated or not.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to