hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/iio/iio_utils.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* IIO - useful set of util functionality
23 *
34 * Copyright (c) 2008 Jonathan Cameron
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published by
7
- * the Free Software Foundation.
85 */
96 #include <string.h>
107 #include <stdlib.h>
....@@ -546,6 +543,10 @@
546543 {
547544 int count = 0;
548545
546
+ /* It takes a digit to represent zero */
547
+ if (!num)
548
+ return 1;
549
+
549550 while (num != 0) {
550551 num /= 10;
551552 count++;