diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-03-08 19:31:16 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-03-08 19:31:16 +0000 |
commit | 7e2a1c233ab2eac8e3f65dd1ee1647b336ef588c (patch) | |
tree | 55e4683d889d22dfe3d3a8bc8260fb2956828d74 /plugins/ExternalAPI | |
parent | 5e3d3e76ed1d3cae5c651b2cdb4dfed4dde5c498 (diff) |
fixed some compiler warnings
git-svn-id: http://svn.miranda-ng.org/main/trunk@3924 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ExternalAPI')
-rw-r--r-- | plugins/ExternalAPI/m_folders.h | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h index 550f52f44c..bb8c1bfb56 100644 --- a/plugins/ExternalAPI/m_folders.h +++ b/plugins/ExternalAPI/m_folders.h @@ -141,12 +141,6 @@ typedef struct{ */
#define ME_FOLDERS_PATH_CHANGED "Folders/On/Path/Changed"
-#ifndef FOLDERS_NO_HELPER_FUNCTIONS
-
-#ifndef M_UTILS_H__
-#error The helper functions require that m_utils.h be included in the project. Please include that file if you want to use the helper functions. If you don''t want to use the functions just define FOLDERS_NO_HELPER_FUNCTIONS.
-#endif
-
__inline static HANDLE FoldersRegisterCustomPath(const char *section, const char *name, const char *defaultPath)
{
if (!ServiceExists(MS_FOLDERS_REGISTER_PATH)) return 0;
@@ -179,7 +173,7 @@ __inline static INT_PTR FoldersGetCustomPath(HANDLE hFolderEntry, char *path, co INT_PTR res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
if (res) {
char buffer[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ PathToAbsolute(notFound, buffer);
mir_snprintf(path, size, "%s", buffer);
}
@@ -196,7 +190,7 @@ __inline static INT_PTR FoldersGetCustomPathW(HANDLE hFolderEntry, wchar_t *path INT_PTR res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
if (res) {
wchar_t buffer[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTEW, (WPARAM) notFoundW, (LPARAM) buffer);
+ PathToAbsoluteW(notFoundW, buffer);
mir_sntprintf(pathW, size, _T("%s"), buffer);
}
@@ -212,17 +206,17 @@ __inline static INT_PTR FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, INT_PTR res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
if (res) {
char buffer[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) notFound, (LPARAM) buffer);
+ PathToAbsolute(notFound, buffer);
mir_snprintf(path, size, "%s", buffer);
}
if (strlen(path) > 0)
- strcat(path, "\\");
+ strncat(path, "\\", size);
else
path[0] = '\0';
if (fileName)
- strcat(path, fileName);
+ strncat(path, fileName, size);
return res;
}
@@ -237,17 +231,17 @@ __inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pa INT_PTR res = CallService(MS_FOLDERS_GET_PATH, (WPARAM) hFolderEntry, (LPARAM) &fgd);
if (res) {
wchar_t buffer[MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTEW, (WPARAM) notFoundW, (LPARAM) buffer);
+ PathToAbsoluteW(notFoundW, buffer);
mir_sntprintf(pathW, size, _T("%s"), buffer);
}
if (wcslen(pathW) > 0)
- wcscat(pathW, L"\\");
+ wcsncat(pathW, L"\\",size);
else
pathW[0] = L'\0';
if (fileNameW)
- wcscat(pathW, fileNameW);
+ wcsncat(pathW, fileNameW, size);
return res;
}
@@ -263,6 +257,5 @@ __inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pa # define FoldersRegisterCustomPathT FoldersRegisterCustomPath
#endif
-#endif
#endif //M_CUSTOM_FOLDERS_H
\ No newline at end of file |