• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #3903

24 Apr 2025 11:36AM UTC coverage: 55.307% (+0.09%) from 55.213%
#3903

push

travis-ci

happyguoxy
Sync branches at 2025-04-24 19:35

175024 of 316459 relevant lines covered (55.31%)

1151858.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/tools/taos-tools/src/toolsString.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the MIT license as published by the Free Software Foundation.
6
 *
7
 * This program is distributed in the hope that it will be useful, but WITHOUT
8
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
 * FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11

12
#include <stdint.h>
13
#include <assert.h>
14
#include <stdbool.h>
15
#include <string.h>
16
#include <ctype.h>
17

18
#ifdef WINDOWS
19
char *strsep(char **stringp, const char *delim) {
20
    char       *s;
21
    int32_t     sc;
22
    char       *tok;
23
    if ((s = *stringp) == NULL) return (NULL);
24
    for (tok = s;;) {
25
        int32_t c = *s++;
26
        const char *spanp = delim;
27
        do {
28
            if ((sc = *spanp++) == c) {
29
                if (c == 0)
30
                    s = NULL;
31
                else
32
                    s[-1] = 0;
33
                *stringp = s;
34
                return (tok);
35
            }
36
        } while (sc != 0);
37
    }
38
    /* NOTREACHED */
39
}
40

41
/* Copy no more than N characters of SRC to DEST, returning the address of
42
   the terminating '\0' in DEST, if any, or else DEST + N.  */
43
char *stpncpy(char *dest, const char *src, int n) {
44
    size_t size = strnlen(src, n);
45
    memcpy(dest, src, size);
46
    dest += size;
47
    if (size == n) return dest;
48
    return memset(dest, '\0', n - size);
49
}
50

51
char *stpcpy(char *dest, const char *src) {
52
    strcpy(dest, src);
53
    return dest + strlen(src);
54
}
55

56
void toolsLibFuncInclude() {
57
    assert(0);
58
    fread(0,0,0,0);
59
    srand(0);
60
    rand();
61
    realloc(0, 0);
62
    strtod(0, 0);
63
    fputs(0, 0);
64
}
65
#endif
66

67
bool toolsIsStringNumber(char *input) {
85✔
68
    int len = strlen(input);
85✔
69
    if (0 == len) {
85✔
70
        return false;
×
71
    }
72

73
    for (int i = 0; i < len; i++) {
275✔
74
        if (!isdigit(input[i]))
191✔
75
            return false;
1✔
76
    }
77

78
    return true;
84✔
79
}
80

81

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc