Skip to content

Commit 9969ff0

Browse files
committed
solaris: fix strncpy truncation warnings
Signed-off-by: Brice Goglin <[email protected]>
1 parent 1961c59 commit 9969ff0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hwloc/topology-solaris-chiptype.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright © 2009-2010 Oracle and/or its affiliates. All rights reserved.
33
* Copyright © 2013 Université Bordeaux. All rights reserved.
4-
* Copyright © 2016-2018 Inria. All rights reserved.
4+
* Copyright © 2016-2020 Inria. All rights reserved.
55
*
66
* $COPYRIGHT$
77
*
@@ -300,8 +300,10 @@ static void assign_string_value(int index, char* string_val) {
300300
}
301301
} else if (index == INDEX_PROCESSOR_TYPE) { /* ProcessorType */
302302
strncpy(&dss_chip_type[0], string_val, PICL_PROPNAMELEN_MAX);
303+
dss_chip_type[PICL_PROPNAMELEN_MAX] = 0;
303304
} else if (index == INDEX_BRAND_STRING) { /* brand-string */
304305
strncpy(&dss_chip_model[0], string_val, PICL_PROPNAMELEN_MAX);
306+
dss_chip_type[PICL_PROPNAMELEN_MAX] = 0;
305307
}
306308
}
307309

0 commit comments

Comments
 (0)