This follows the pattern we have for other optional strings returned by
the library.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I775f4f3be917bde405ad3b5e63183dae9609cf03
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2833
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
<code>-pre5</code> or <code>-rc1</code>.
@returns
<code>-pre5</code> or <code>-rc1</code>.
@returns
- @parblock
- Extra information about the library's version.
-
- Cannot be \c NULL.
-
- Can be an empty string if there's no extra information.
- @endparblock
+ Extra information about the library's version, or \c NULL if none.
*/
extern const char *bt_version_get_extra(void);
*/
extern const char *bt_version_get_extra(void);
#include <babeltrace2/babeltrace.h>
#include <stdlib.h>
#include <babeltrace2/babeltrace.h>
#include <stdlib.h>
unsigned int bt_version_get_major(void)
{
unsigned int bt_version_get_major(void)
{
const char *bt_version_get_extra(void)
{
const char *bt_version_get_extra(void)
{
- return BT_VERSION_EXTRA;
+ return strlen(BT_VERSION_EXTRA) == 0 ? NULL : BT_VERSION_EXTRA;