Re: [PATCH 6/9] Remove the rest of VIR_STRNDUP

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

 





On 11/12/19 2:02 PM, Ján Tomko wrote:
Replace all the uses passing a single parameter as the length.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
  src/conf/nwfilter_conf.c               |  4 ++--
  src/conf/nwfilter_params.c             |  6 ++----
  src/interface/interface_backend_udev.c |  8 ++------
  src/libxl/xen_common.c                 |  3 +--
  src/libxl/xen_xl.c                     |  6 ++----
  src/libxl/xen_xm.c                     |  6 ++----
  src/qemu/qemu_monitor_json.c           |  3 +--
  src/rpc/virnetlibsshsession.c          |  7 ++-----
  src/storage/storage_backend_logical.c  |  7 ++-----
  src/util/viriscsi.c                    |  3 +--
  src/util/virjson.c                     | 11 +++--------
  src/util/virkeyfile.c                  |  3 +--
  src/util/virsocketaddr.c               |  5 +----
  src/util/virstoragefile.c              |  3 +--
  src/util/virstring.c                   |  3 +--
  15 files changed, 24 insertions(+), 54 deletions(-)


[...]

diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c
index 9f4c8f4e03..84fa542b7c 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -162,8 +162,7 @@ virStorageBackendIQNFound(const char *initiatoriqn,
          if (!(next = strchr(current, ' ')))
              goto error;
- if (VIR_STRNDUP(iface, current, (next - current)) < 0)
-            goto cleanup;
+        iface = g_strndup(current, (next - current));
current = next + 1;

We can live without the parenthesis around 'next - current'.

Also, I think this change belongs to the previous patch that handled subtraction in the
length argument of VIR_STRNDUP().


Thanks,


DHB




--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux