build-id.c (0aba7f036a56675b7fdc536757b4c49fc76a2208) build-id.c (f766819cd5290d42efa55c505b9bed184fec17bf)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * build-id.c
4 *
5 * build-id support
6 *
7 * Copyright (C) 2009, 2010 Red Hat Inc.
8 * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com>

--- 116 unchanged lines hidden (view full) ---

125 if (ret < 0)
126 return ret;
127
128 return build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
129}
130
131int filename__sprintf_build_id(const char *pathname, char *sbuild_id)
132{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * build-id.c
4 *
5 * build-id support
6 *
7 * Copyright (C) 2009, 2010 Red Hat Inc.
8 * Copyright (C) 2009, 2010 Arnaldo Carvalho de Melo <acme@redhat.com>

--- 116 unchanged lines hidden (view full) ---

125 if (ret < 0)
126 return ret;
127
128 return build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
129}
130
131int filename__sprintf_build_id(const char *pathname, char *sbuild_id)
132{
133 u8 build_id[BUILD_ID_SIZE];
133 struct build_id bid;
134 int ret;
135
134 int ret;
135
136 ret = filename__read_build_id(pathname, build_id, sizeof(build_id));
136 ret = filename__read_build_id(pathname, &bid);
137 if (ret < 0)
138 return ret;
137 if (ret < 0)
138 return ret;
139 else if (ret != sizeof(build_id))
140 return -EINVAL;
141
139
142 return build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
140 return build_id__sprintf(bid.data, sizeof(bid.data), sbuild_id);
143}
144
145/* asnprintf consolidates asprintf and snprintf */
146static int asnprintf(char **strp, size_t size, const char *fmt, ...)
147{
148 va_list ap;
149 int ret;
150

--- 754 unchanged lines hidden ---
141}
142
143/* asnprintf consolidates asprintf and snprintf */
144static int asnprintf(char **strp, size_t size, const char *fmt, ...)
145{
146 va_list ap;
147 int ret;
148

--- 754 unchanged lines hidden ---