mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
gobject: Remove bogus NULL test for UUIDs
Many warnings such as:
src/session.c: In function 'guestfs_session_internal_test_rstruct':
src/session.c:14755:7: warning: the comparison will always evaluate as 'true' for the address of 'pv_uuid' will never be NULL [-Waddress]
14755 | if (ret->pv_uuid) memcpy (s->pv_uuid, ret->pv_uuid, sizeof (s->pv_uuid));
| ^~~
In file included from src/session.c:40:
../include/guestfs.h:551:8: note: 'pv_uuid' declared here
551 | char pv_uuid[32]; /* this is NOT nul-terminated, be careful when printing */
| ^~~~~~~
(cherry picked from commit 5c63ec2a53)
This commit is contained in:
@@ -1226,8 +1226,8 @@ guestfs_session_close (GuestfsSession *session, GError **err)
|
||||
| n, (FChar|FUInt32|FInt32|FUInt64|FBytes|FInt64|FOptPercent) ->
|
||||
pr "%s%s%s = %s%s;\n" indent dst n src n
|
||||
| n, FUUID ->
|
||||
pr "%sif (%s%s) memcpy (%s%s, %s%s, sizeof (%s%s));\n"
|
||||
indent src n dst n src n dst n
|
||||
pr "%smemcpy (%s%s, %s%s, sizeof (%s%s));\n"
|
||||
indent dst n src n dst n
|
||||
| n, FString ->
|
||||
pr "%sif (%s%s) %s%s = g_strdup (%s%s);\n"
|
||||
indent src n dst n src n
|
||||
|
||||
Reference in New Issue
Block a user