Coverage Report

Created: 2026-02-26 06:20

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/ntp-dev/libntp/refnumtoa.c
Line
Count
Source
1
/*
2
 * refnumtoa - return asciized refclock addresses stored in local array space
3
 */
4
#include <config.h>
5
#include <stdio.h>
6
7
#include "ntp_net.h"
8
#include "ntp_stdlib.h"
9
10
const char *
11
refnumtoa(
12
  const sockaddr_u *num
13
  )
14
0
{
15
0
  u_int32 netnum;
16
0
  char *buf;
17
0
  const char *rclock;
18
19
0
  if (!ISREFCLOCKADR(num))
20
0
    return socktoa(num);
21
22
0
  LIB_GETBUF(buf);
23
0
  netnum = SRCADR(num);
24
0
  rclock = clockname((int)((u_long)netnum >> 8) & 0xff);
25
26
0
  if (rclock != NULL)
27
0
    snprintf(buf, LIB_BUFLENGTH, "%s(%lu)",
28
0
       rclock, (u_long)netnum & 0xff);
29
0
  else
30
0
    snprintf(buf, LIB_BUFLENGTH, "REFCLK(%lu,%lu)",
31
0
       ((u_long)netnum >> 8) & 0xff,
32
0
       (u_long)netnum & 0xff);
33
34
0
  return buf;
35
0
}