summaryrefslogtreecommitdiff
path: root/src/upb.c
blob: 938c72d8f9c5d1dc02087e1a55ca03fac97c48a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * upb - a minimalist implementation of protocol buffers.
 *
 * Copyright (c) 2009 Joshua Haberman.  See LICENSE for details.
 *
 */

#include <stdarg.h>
#include <stddef.h>

#include "upb.h"

void upb_seterr(upb_status *status, enum upb_status_code code,
                const char *msg, ...)
{
  if(upb_ok(status)) {  // The first error is the most interesting.
    status->code = code;
    va_list args;
    va_start(args, msg);
    vsnprintf(status->msg, UPB_ERRORMSG_MAXLEN, msg, args);
    va_end(args);
  }
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback