Type: fix
Ticket: VPP-1837
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6b1ea13fc83460bf4ee75cb9249d83dddaa64ded
clib_panic ("sigaction");
/* Retrieve the current terminal size */
clib_panic ("sigaction");
/* Retrieve the current terminal size */
- ioctl (STDIN_FILENO, TIOCGWINSZ, &ws);
- cf->width = ws.ws_col;
- cf->height = ws.ws_row;
+ if (ioctl (STDIN_FILENO, TIOCGWINSZ, &ws) == 0)
+ {
+ cf->width = ws.ws_col;
+ cf->height = ws.ws_row;
+ }
if (cf->width == 0 || cf->height == 0)
{
if (cf->width == 0 || cf->height == 0)
{
unformat_free (&sub_input);
done:
unformat_free (&sub_input);
done:
close (fd);
vec_free (file_name);
close (fd);
vec_free (file_name);
hash_foreach_pair (hp, am->msg_index_by_name_and_crc,
({
rp->message_table[i].index = htons(hp->value[0]);
hash_foreach_pair (hp, am->msg_index_by_name_and_crc,
({
rp->message_table[i].index = htons(hp->value[0]);
- strncpy_s((char *)rp->message_table[i].name, 64 /* bytes of space at dst */,
- (char *)hp->key, 64-1 /* chars to copy, without zero byte. */);
+ (void) strncpy_s((char *)rp->message_table[i].name,
+ 64 /* bytes of space at dst */,
+ (char *)hp->key,
+ 64-1 /* chars to copy, without zero byte. */);
i++;
}));
/* *INDENT-ON* */
i++;
}));
/* *INDENT-ON* */
pool_foreach (hif, im->hw_interfaces, ({
unserialize_cstring (m, &class_name);
p = hash_get_mem (im->hw_interface_class_by_name, class_name);
pool_foreach (hif, im->hw_interfaces, ({
unserialize_cstring (m, &class_name);
p = hash_get_mem (im->hw_interface_class_by_name, class_name);
- ASSERT (p != 0);
- error = vnet_hw_interface_set_class_helper (vnm, hif->hw_if_index, p[0], /* redistribute */ 0);
+ if (p)
+ {
+ error = vnet_hw_interface_set_class_helper
+ (vnm, hif->hw_if_index, p[0], /* redistribute */ 0);
+ }
+ else
+ error = clib_error_return (0, "hw class %s AWOL?", class_name);
+
if (error)
clib_error_report (error);
vec_free (class_name);
if (error)
clib_error_report (error);
vec_free (class_name);
always_inline void *
clib_mem_get_per_numa_heap (u32 numa_id)
{
always_inline void *
clib_mem_get_per_numa_heap (u32 numa_id)
{
- ASSERT (numa_id >= 0 && numa_id < ARRAY_LEN (clib_per_numa_mheaps));
+ ASSERT (numa_id < ARRAY_LEN (clib_per_numa_mheaps));
return clib_per_numa_mheaps[numa_id];
}
return clib_per_numa_mheaps[numa_id];
}