#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <assert.h>
+#include <babeltrace/assert-internal.h>
#include <stdarg.h>
#include <ctype.h>
#include <glib.h>
const char *end;
size_t init_dirs_len;
- assert(dirs);
+ BT_ASSERT(dirs);
init_dirs_len = dirs->len;
if (!paths) {
{
const char *ch;
bool printable = true;
- assert(input);
+ BT_ASSERT(input);
for (ch = input; *ch != '\0'; ch++) {
if (!isprint(*ch) && *ch != '\n' && *ch != '\r' &&
const char *at = url;
size_t end_pos;
- assert(url);
+ BT_ASSERT(url);
memset(&parts, 0, sizeof(parts));
parts.port = -1;
char *np;
bool got_star = false;
- assert(pattern);
+ BT_ASSERT(pattern);
for (p = pattern, np = pattern; *p != '\0'; p++) {
switch (*p) {
* ^ ^ SUCCESS
*/
while ((c - candidate) < candidate_len && *c != '\0') {
- assert(*c);
+ BT_ASSERT(*c);
if (at_end_of_pattern(p, pattern, pattern_len)) {
goto end_of_pattern;
if (ch - last > 0) {
GString *part = g_string_new(NULL);
- assert(part);
+ BT_ASSERT(part);
g_string_append_len(part, last, ch - last);
g_ptr_array_add(parts, part);
}
char *tmp;
GString *norm_path = NULL;
- assert(path);
+ BT_ASSERT(path);
tmp = _fullpath(NULL, path, PATH_MAX);
if (!tmp) {
GString *norm_path;
GPtrArray *parts = NULL;
- assert(path);
+ BT_ASSERT(path);
norm_path = g_string_new(G_DIR_SEPARATOR_S);
if (!norm_path) {
goto error;
strncpy(_tmp_fmt, *out_fmt_ch, _tmp_fmt_size); \
_tmp_fmt[_tmp_fmt_size] = '\0'; \
_count = snprintf(*buf_ch, _size, _tmp_fmt, __VA_ARGS__); \
- assert(_count >= 0); \
+ BT_ASSERT(_count >= 0); \
*buf_ch += MIN(_count, _size); \
} while (0)
}
/* format (PRI*64) */
- if (strncmp(fmt_ch, PRId64, sizeof(PRId64)) == 0) {
- fmt_ch += sizeof(PRId64);
+ if (strncmp(fmt_ch, PRId64, sizeof(PRId64) - 1) == 0) {
+ fmt_ch += sizeof(PRId64) - 1;
BUF_STD_APPEND_SINGLE_ARG(int64_t);
goto update_rw_fmt;
- } else if (strncmp(fmt_ch, PRIu64, sizeof(PRIu64)) == 0) {
- fmt_ch += sizeof(PRIu64);
+ } else if (strncmp(fmt_ch, PRIu64, sizeof(PRIu64) - 1) == 0) {
+ fmt_ch += sizeof(PRIu64) - 1;
BUF_STD_APPEND_SINGLE_ARG(uint64_t);
goto update_rw_fmt;
- } else if (strncmp(fmt_ch, PRIx64, sizeof(PRIx64)) == 0) {
- fmt_ch += sizeof(PRIx64);
+ } else if (strncmp(fmt_ch, PRIx64, sizeof(PRIx64) - 1) == 0) {
+ fmt_ch += sizeof(PRIx64) - 1;
BUF_STD_APPEND_SINGLE_ARG(uint64_t);
goto update_rw_fmt;
- } else if (strncmp(fmt_ch, PRIX64, sizeof(PRIX64)) == 0) {
- fmt_ch += sizeof(PRIX64);
+ } else if (strncmp(fmt_ch, PRIX64, sizeof(PRIX64) - 1) == 0) {
+ fmt_ch += sizeof(PRIX64) - 1;
BUF_STD_APPEND_SINGLE_ARG(uint64_t);
goto update_rw_fmt;
- } else if (strncmp(fmt_ch, PRIo64, sizeof(PRIo64)) == 0) {
- fmt_ch += sizeof(PRIo64);
+ } else if (strncmp(fmt_ch, PRIo64, sizeof(PRIo64) - 1) == 0) {
+ fmt_ch += sizeof(PRIo64) - 1;
BUF_STD_APPEND_SINGLE_ARG(uint64_t);
goto update_rw_fmt;
- } else if (strncmp(fmt_ch, PRIi64, sizeof(PRIi64)) == 0) {
- fmt_ch += sizeof(PRIi64);
+ } else if (strncmp(fmt_ch, PRIi64, sizeof(PRIi64) - 1) == 0) {
+ fmt_ch += sizeof(PRIi64) - 1;
BUF_STD_APPEND_SINGLE_ARG(int64_t);
goto update_rw_fmt;
}
const char *fmt_ch = fmt;
char *buf_ch = buf;
- assert(buf);
- assert(fmt);
- assert(*args);
+ BT_ASSERT(buf);
+ BT_ASSERT(fmt);
+ BT_ASSERT(*args);
while (*fmt_ch != '\0') {
switch (*fmt_ch) {
case '%':
- assert(fmt_ch[1] != '\0');
+ BT_ASSERT(fmt_ch[1] != '\0');
if (fmt_ch[1] == intro) {
handle_specifier(priv_data, &buf_ch,