1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-08-25 13:49:28 +03:00

A bit more safe version of sprintf

Use just buffer size limit (it's used for debug only)
This commit is contained in:
Zdenek Kabelac
2012-02-27 10:17:06 +00:00
parent e1153fd385
commit 25555737bd

View File

@ -303,7 +303,7 @@ static const char *decode_cmd(unsigned char cmdl)
break;
}
sprintf(buf, "%s (0x%x)", command, cmdl);
snprintf(buf, sizeof(buf), "%s (0x%x)", command, cmdl);
return buf;
}