on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
-
+
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
Thus it (39th element) cannot be used in referencing Fieldstab.
However, two enums of higher value (X_XON=40 and X_XOF=41) *can* appear in those arrays.
But the test against the fencepost ensures that those two enums are *never* used in referencing Fieldstab.
-
+
When the analyzer sees the conditional using '<' and not '<=' it reports a false positive.
-
+
i'm tired of explaining this so the program was changed to accommodate the tool's deficiency
my_category: unavoidable_false_positive_but_patched_anyway
top.c:1417: overrun-local: Overrunning static array "Fieldstab", with 39 elements, at position 39 with index variable "f".
exit(1);
}
-
+
if (list) {
ut = fopen(UTMP_FILE, "r");
while (fread(&uts, sizeof(uts), 1, ut))
printf("ut_user: %s\n", user);
printf("ut_host: %s\n", host);
printf("ut_addr: %d\n\n", uts.ut_addr);
-
+
printf("Modify this record? (y/N): "); fflush(stdout);
/* Ask if to delete or no */
if ((ch = getchar()) == 'y' || ch == 'Y') {
if (opt_newest) saved_pid = 0;
if (opt_oldest) saved_pid = INT_MAX;
-
+
memset(&task, 0, sizeof (task));
while(readproc(ptp, &task)) {
int match = 1;
}
-
+
/* These options are for pgrep only */
strcat (opts, "lad:vw");
}
-
+
strcat (opts, "LF:cfnoxP:g:s:u:U:G:t:?Vh");
-
+
while ((opt = getopt_long (argc, argv, opts, longopts, NULL)) != -1) {
switch (opt) {
case SIGNAL_OPTION:
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
-
+
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
int my_cells = 0;
int my_bytes = 0;
mbstate_t s;
-
+
memset(&s, 0, sizeof (s));
-
+
for(;;) {
wchar_t wc;
int len = 0;
-
+
if(my_cells >= *maxcells || my_bytes+1 >= bufsize)
break;
-
+
if (!(len = mbrtowc (&wc, src, MB_CUR_MAX, &s)))
/* 'str' contains \0 */
break;
-
+
if (len < 0) {
/* invalid multibyte sequence -- zeroize state */
memset (&s, 0, sizeof (s));
src+=len;
my_cells++;
my_bytes++;
-
+
} else {
/* multibyte - printable */
int wlen = wcwidth(wc);
*dst = '\0';
// fprintf(stderr, "maxcells: %d, my_cells; %d\n", *maxcells, my_cells);
-
+
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}
"????????????????????????????????"
"????????????????????????????????"
"????????????????????????????????";
-
+
#if (__GNU_LIBRARY__ >= 6) && (!defined(__UCLIBC__) || defined(__UCLIBC_HAS_WCHAR__))
static int utf_init=0;
-
+
if(utf_init==0){
/* first call -- check if UTF stuff is usable */
char *enc = nl_langinfo(CODESET);
return escape_str_utf8(dst, src, bufsize, maxcells);
}
#endif
-
+
if(bufsize > *maxcells+1) bufsize=*maxcells+1; // FIXME: assumes 8-bit locale
for(;;){
*(dst++) = c;
}
*dst = '\0';
-
+
*maxcells -= my_cells;
return my_bytes; // bytes of text, excluding the NUL
}
if (buffer[0] == '#')
continue;
-
+
curr = get_slabnode();
if (!curr)
break;
new_y = 0;
tmp_z = 0.0;
new_z = 0;
-
+
FILE_TO_BUF(STAT_FILE,stat_fd);
sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &new_u, &new_n, &new_s, &new_i, &new_w, &new_x, &new_y, &new_z);
ticks_past = (new_u+new_n+new_s+new_i+new_w+new_x+new_y+new_z)-(old_u+old_n+old_s+old_i+old_w+old_x+old_y+old_z);
void loadavg(double *restrict av1, double *restrict av5, double *restrict av15) {
double avg_1=0, avg_5=0, avg_15=0;
char *savelocale;
-
+
FILE_TO_BUF(LOADAVG_FILE,loadavg_fd);
savelocale = strdup(setlocale(LC_NUMERIC, NULL));
setlocale(LC_NUMERIC, "C");
#ifdef __linux__
static struct utsname uts;
-
+
if (uname(&uts) == -1) /* failure implies impending death */
exit(1);
fclose(fp);
version_string_depth = sscanf(buf, "Linux version %d.%d.%d", &x, &y, &z);
#endif /* __linux__ */
-
+
if ((version_string_depth < 2) || /* Non-standard for all known kernels */
((version_string_depth < 3) && (x < 3))) /* Non-standard for 2.x.x kernels */
#ifdef __linux__
list = list->next;
b = b->next->next;
}
-
+
b = list->next;
list->next = NULL;
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};
-
#ifdef HAVE_PROGRAM_INVOCATION_NAME
program_invocation_name = program_invocation_short_name;
#endif
fputc('-', stdout);
}
} else { /* multiple colons found - it's an IPv6 address */
-
+
/* search for % (interface separator in case of IPv6 link address) */
while ( (tmp < (host + len)) && (*tmp != '%') && isprint(*tmp) ) tmp++;
if (*tmp == '%') { /* interface separator found */
-
+
/* number of chars till the end of the input field */
len -= (tmp - host);