mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
Janitor project to convert sizeof to ARRAY_LEN macro.
(closes issue #13002) Reported by: caio1982 Patches: janitor_arraylen5.diff uploaded by caio1982 (license 22) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@129045 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -530,7 +530,7 @@ static int rotate_file(const char *filename)
|
||||
/* Find the next empty slot, including a possible suffix */
|
||||
for (x = 0; ; x++) {
|
||||
found = 0;
|
||||
for (which = 0; which < sizeof(suffixes) / sizeof(suffixes[0]); which++) {
|
||||
for (which = 0; which < ARRAY_LEN(suffixes); which++) {
|
||||
snprintf(new, sizeof(new), "%s.%d%s", filename, x, suffixes[which]);
|
||||
fd = open(new, O_RDONLY);
|
||||
if (fd > -1)
|
||||
@@ -546,7 +546,7 @@ static int rotate_file(const char *filename)
|
||||
|
||||
/* Found an empty slot */
|
||||
for (y = x; y > -1; y--) {
|
||||
for (which = 0; which < sizeof(suffixes) / sizeof(suffixes[0]); which++) {
|
||||
for (which = 0; which < ARRAY_LEN(suffixes); which++) {
|
||||
snprintf(old, sizeof(old), "%s.%d%s", filename, y - 1, suffixes[which]);
|
||||
fd = open(old, O_RDONLY);
|
||||
if (fd > -1) {
|
||||
|
Reference in New Issue
Block a user