Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mlschroe:crosstest
slurm.32299
U_26-Reclaim-a-second-tab-stop.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File U_26-Reclaim-a-second-tab-stop.patch of Package slurm.32299
From: Tim Wickberg <tim@schedmd.com> Date: Wed Nov 29 15:52:37 2023 -0700 Subject: [PATCH 26/28]Reclaim a second tab stop. Patch-mainline: Upstream Git-repo: https://github.com/SchedMD/slurm Git-commit: ef64ea109358d8776652ea2bffba23f0927e0376 References: bsc#1218046, bsc#1218050, bsc#1218051, bsc#1218053 Signed-off-by: Egbert Eich <eich@suse.de> --- src/common/pack.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/common/pack.c b/src/common/pack.c index 620d82c542..5debcb4775 100644 --- a/src/common/pack.c +++ b/src/common/pack.c @@ -1003,6 +1003,7 @@ unpack_error: int unpackstr_xmalloc_escaped(char **valp, uint32_t *size_valp, Buf buffer) { uint32_t cnt; + char *copy = NULL, *str, tmp; *valp = NULL; safe_unpack32(size_valp, buffer); @@ -1023,26 +1024,22 @@ int unpackstr_xmalloc_escaped(char **valp, uint32_t *size_valp, Buf buffer) /* make a buffer 2 times the size just to be safe */ *valp = xmalloc_nz((cnt * 2) + 1); - if (*valp) { - char *copy = NULL, *str, tmp; - uint32_t i; - copy = *valp; - str = &buffer->head[buffer->processed]; - - for (i = 0; i < cnt && *str; i++) { - tmp = *str++; - if ((tmp == '\\') || (tmp == '\'')) { - *copy++ = '\\'; - (*size_valp)++; - } - - *copy++ = tmp; + copy = *valp; + str = &buffer->head[buffer->processed]; + + for (uint32_t i = 0; i < cnt && *str; i++) { + tmp = *str++; + if ((tmp == '\\') || (tmp == '\'')) { + *copy++ = '\\'; + (*size_valp)++; } - /* Since we used xmalloc_nz, terminate the string. */ - *copy++ = '\0'; + *copy++ = tmp; } + /* Since we used xmalloc_nz, terminate the string. */ + *copy++ = '\0'; + /* add the original value since that is what we processed */ buffer->processed += cnt;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor