1 Star 0 Fork 71

章北海/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
util-Drop-pointless-NUL_TERMINATE-macro.patch 894 Bytes
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-11-25 19:41 . sync some bugfix patches from upstream
From 28781bb30db71760da3c88a5c34903ee1387d20b Mon Sep 17 00:00:00 2001
From: Xu Zheng <xuzheng_yewu@cmss.chinamobile.com>
Date: Thu, 24 Nov 2022 18:12:49 +0800
Subject: [PATCH 21/23] util: Drop pointless NUL_TERMINATE macro
It's only used once and open coding it is at least as clear as using the
macro.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Xu Zheng <xuzheng_yewu@cmss.chinamobile.com>
---
src/internal.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/internal.h b/src/internal.h
index a1068eb63b..302fddba34 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -87,7 +87,6 @@
#define STREQ_NULLABLE(a, b) (g_strcmp0(a, b) == 0)
#define STRNEQ_NULLABLE(a, b) (g_strcmp0(a, b) != 0)
-#define NUL_TERMINATE(buf) do { (buf)[sizeof(buf)-1] = '\0'; } while (0)
#ifdef WIN32
# ifndef O_CLOEXEC
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dependent/libvirt.git
git@gitee.com:dependent/libvirt.git
dependent
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385