Commit Graph

7 Commits

Author SHA1 Message Date
Sami Kerola f7ff041409 lib/mbsalign: initializations values are never read [clang-analyzer]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-07-09 14:25:02 +02:00
Sami Kerola 3acc206d39 various: fix variable and function declarations [smatch scan]
disk-utils/fsck.minix.c:511:9: warning: mixing declarations and code
fdisks/sfdisk.c:982:5: warning: mixing declarations and code
fdisks/sfdisk.c:1254:5: warning: mixing declarations and code
fdisks/sfdisk.c:1564:5: warning: mixing declarations and code
lib/mbsalign.c:279:7: warning: mixing declarations and code
libblkid/src/devname.c:378:17: warning: mixing declarations and code
libfdisk/src/alignment.c:219:9: warning: mixing declarations and code
term-utils/wall.c:111:9: warning: mixing declarations and code
text-utils/col.c:418:19: warning: non-ANSI function declaration of function 'flush_blanks'
text-utils/col.c:553:12: warning: non-ANSI function declaration of function 'alloc_line'
text-utils/rev.c:105:9: warning: mixing declarations and code
text-utils/tailf.c:245:9: warning: mixing declarations and code

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-09 12:17:20 +02:00
Pádraig Brady 36c7f78524 lib/mbsalign: correct license header from GPLv[23] to LGPLv2+
* lib/mbsalign.c: s/GPLv3/LGPLv2+/
* include/mbsalign.h: s/GPLv2/LGPLv2+/
* README.licensing: Remove mention GPLv3 as it's not actually used.
2013-03-20 14:03:28 +01:00
Sami Kerola ce7b11a98e lib/mbsalign: abort() when non-expected case is encountered
Fixes the following compiler warning (9 occurrences), and makes program
to crash if mbsaligh() is called with unexpected align value (which
would be programming error).

../lib/mbsalign.c:260:7: warning: switch missing default case [-Wswitch-default]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-17 17:59:59 +02:00
Sami Kerola 2897f29a10 cfdisk: data type mismatch, and other, compiler warning fixes
Following warnings will longer appear when one will compile with
gcc flags -Wall -Wextra -pedantic

cfdisk.c:475:3: warning: comparison of unsigned expression < 0 is always false
cfdisk.c:487:16: warning: comparison between signed and unsigned integer expressions
cfdisk.c:492:14: warning: comparison between signed and unsigned integer expressions
cfdisk.c:565:19: warning: comparison between signed and unsigned integer expressions
cfdisk.c:569:19: warning: comparison between signed and unsigned integer expressions
cfdisk.c:1070:14: warning: comparison between signed and unsigned integer expressions
cfdisk.c:1568:5: warning: missing initializer
cfdisk.c:1568:5: warning: (near initialization for 'tmp_ext.volume_label')

mbsalign.c:131:2: warning: comparison of unsigned expression >= 0 is always true

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-01-25 10:40:34 +01:00
Karel Zak 5f94ca33cf cfdisk: support non-ascii characters in input
On Sat, Apr 03, 2010 at 12:58:48PM +0000, Jorge wrote:
> When you want to write changes to disk you're asked for a
> confirmation, like this one:
>
>   Are you sure you want to write the partition table to disk? (yes
>   or no)
>
> There is no problem on the English version, but when you launch the
> program in Spanish you get this:
>
>   ¿Está seguro de que desea escribir la tabla de particiones en el
> disco?
>      (sí o no):
>
> You can't type the "í" character. Trying to do so will end in no
> input at all. That is, typing in my keyboard "´" then "i" leads to
> nothing. So you can't write changes to disk, and you must launch the
> program in English for it to operate.

Reported-by: Jorge <yo@jorgesuarezdelis.name>
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/205327
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-07 14:12:26 +02:00
Pádraig Brady 104b92f848 cal: factor out and update multibyte alignment code
* include/mbsalign.h: New module interface
* lib/mbsalign.c: Updated implementation synced from coreutils
* include/Makefile.am: Add mbsalign.h
* misc-utils/Makefile.am: Make cal dependent on mbsalign module
* misc-utils/cal.c: Call mbsalign()

[kzak@redhat.com: - use min() macro from c.h]

Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-16 15:16:11 +01:00