Change-Id: I25508293e1daa8aeb95b9133298d088e2353b6c8
char tpk_path[MAX_FILE_LEN];
char wgt_path[MAX_FILE_LEN];
char tpk_path[MAX_FILE_LEN];
char wgt_path[MAX_FILE_LEN];
- sprintf(tpk_path, "%s/preloaded", app_root_path);
- sprintf(wgt_path, "%s/res/wgt/preloaded", app_root_path);
+ snprintf(tpk_path, sizeof(tpk_path), "%s/preloaded", app_root_path);
+ snprintf(wgt_path, sizeof(wgt_path), "%s/res/wgt/preloaded", app_root_path);
if ((access(tpk_path, F_OK) == 0) || (access(wgt_path, F_OK) == 0))
{
if ((access(tpk_path, F_OK) == 0) || (access(wgt_path, F_OK) == 0))
{
- sprintf(srcdir,"%s/%s",srcpath,(char *) e->d_name);
- sprintf(destdir,"%s/%s",destpath,(char *) e->d_name);
+ snprintf(srcdir, sizeof(srcdir), "%s/%s", srcpath, (char *)e->d_name);
+ snprintf(destdir, sizeof(destdir), "%s/%s", destpath, (char *)e->d_name);
if (stat (srcdir, &statb) == -1)
{
DEBUG_ERROR("stat %s is failed \n",srcdir);
if (stat (srcdir, &statb) == -1)
{
DEBUG_ERROR("stat %s is failed \n",srcdir);
- sprintf(srcdir, "%s/%s", srcpath, (char *)e->d_name);
- sprintf(destdir, "%s/%s", destpath, (char *)e->d_name);
+ snprintf(srcdir, sizeof(srcdir), "%s/%s", srcpath, (char *)e->d_name);
+ snprintf(destdir, sizeof(destdir), "%s/%s", destpath, (char *)e->d_name);
if (stat(srcdir, &statb) == -1)
{
if (stat(srcdir, &statb) == -1)
{
- sprintf(destdir,"%s/%s",parent,appid);
+ snprintf(destdir, sizeof(destdir), "%s/%s", parent, appid);
ret = make_dir(destdir);
if (ret < 0)
{
ret = make_dir(destdir);
if (ret < 0)
{
- sprintf(path,"%s/shared/res", rootpath);
+ snprintf(path, sizeof(path), "%s/shared/res", rootpath);
if (!strcmp(type,"wgt"))
{
char srcpath[MAX_FILE_LEN];
if (!strcmp(type,"wgt"))
{
char srcpath[MAX_FILE_LEN];
- sprintf(srcpath,"%s/res/wgt/shared/res", rootpath);
+ snprintf(srcpath, sizeof(srcpath), "%s/res/wgt/shared/res", rootpath);
ret = move_path(srcpath, path);
}
ret = move_path(srcpath, path);
}
- sprintf(destfile,"%s/%s",deletedir,(char *) e->d_name);
+ snprintf(destfile, sizeof(destfile), "%s/%s", deletedir, (char *)e->d_name);
if (lstat (destfile, &statb) == -1)
{
DEBUG_ERROR("lstat %s is failed \n",destfile);
if (lstat (destfile, &statb) == -1)
{
DEBUG_ERROR("lstat %s is failed \n",destfile);
- sprintf(deletedir,"%s/%s", dest_path, appid);
+ snprintf(deletedir, sizeof(deletedir), "%s/%s", dest_path, appid);
if (access(deletedir, F_OK) == -1)
{
if (access(deletedir, F_OK) == -1)
{
/* It must contain "/" character at end of the delete dir path.
* It prevents file path comparing issues when there are many similar path. */
/* It must contain "/" character at end of the delete dir path.
* It prevents file path comparing issues when there are many similar path. */
- sprintf(deletedir,"%s/%s/", dest_path, appid);
+ snprintf(deletedir, sizeof(deletedir), "%s/%s/", dest_path, appid);
//check if current using font is same with uninstall font
deletedir_len = strlen(deletedir);
//check if current using font is same with uninstall font
deletedir_len = strlen(deletedir);