]> git.ipfire.org Git - thirdparty/mdadm.git/commit
Monitor: use devname as char array instead of pointer
authorKinga Tanska <kinga.tanska@intel.com>
Thu, 14 Jul 2022 07:02:10 +0000 (09:02 +0200)
committerJes Sorensen <jsorensen@fb.com>
Thu, 28 Jul 2022 21:10:22 +0000 (17:10 -0400)
commitc8d1c398505b62d9129a4e711f17e4469f4327ff
tree780e9e27726b48eff4a1411199d8397201a4189f
parent751757620afb25a4c02746bf8368a7b5f22352ec
Monitor: use devname as char array instead of pointer

Device name wasn't filled properly due to incorrect use of strcpy.
Strcpy was used twice. Firstly to fill devname with "/dev/md/"
and then to add chosen name. First strcpy result was overwritten by
second one (as a result <device_name> instead of "/dev/md/<device_name>"
was assigned). This commit changes this implementation to use snprintf
and devname with fixed size.

Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Monitor.c