simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
[asterisk/asterisk.git] / image.c
diff --git a/image.c b/image.c
index 3e8e393..ff67c03 100644 (file)
--- a/image.c
+++ b/image.c
  * \author Mark Spencer <markster@digium.com> 
  */
 
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
 
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
 #include "asterisk/sched.h"
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
@@ -103,9 +103,9 @@ static void make_filename(char *buf, int len, char *filename, const char *prefla
                        snprintf(buf, len, "%s.%s", filename, ext);
        } else {
                if (!ast_strlen_zero(preflang))
-                       snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_VAR_DIR, "images", filename, preflang, ext);
+                       snprintf(buf, len, "%s/%s/%s-%s.%s", ast_config_AST_DATA_DIR, "images", filename, preflang, ext);
                else
-                       snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_VAR_DIR, "images", filename, ext);
+                       snprintf(buf, len, "%s/%s/%s.%s", ast_config_AST_DATA_DIR, "images", filename, ext);
        }
 }
 
@@ -153,7 +153,7 @@ struct ast_frame *ast_read_image(char *filename, const char *preflang, int forma
                                lseek(fd, 0, SEEK_SET);
                                f = found->read_image(fd,len); 
                        } else
-                               ast_log(LOG_WARNING, "%s does not appear to be a %s file\n", buf, i->name);
+                               ast_log(LOG_WARNING, "%s does not appear to be a %s file\n", buf, found->name);
                        close(fd);
                } else
                        ast_log(LOG_WARNING, "Unable to open '%s': %s\n", buf, strerror(errno));
@@ -205,7 +205,6 @@ struct ast_cli_entry show_images =
 
 int ast_image_init(void)
 {
-       ast_cli_register(&show_images);
-       return 0;
+       return ast_cli_register(&show_images);
 }