Changeset 7dcefa7 in libguac
- Timestamp:
- 08/23/12 14:50:06 (9 months ago)
- Branches:
- master, debian, rpm, unstable
- Children:
- f6cc43c
- Parents:
- 9de0d0d
- git-author:
- Michael Jumper <zhangmaike@…> (08/23/12 14:50:06)
- git-committer:
- Michael Jumper <zhangmaike@…> (08/23/12 14:50:06)
- Files:
-
- 2 edited
-
include/client.h (modified) (1 diff)
-
src/client.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
include/client.h
r1aaa0a3 r7dcefa7 51 51 */ 52 52 53 /** 54 * String prefix which begins the library filename of all client plugins. 55 */ 56 #define GUAC_PROTOCOL_LIBRARY_PREFIX "libguac-client-" 57 58 /** 59 * String suffix which ends the library filename of all client plugins. 60 */ 61 #define GUAC_PROTOCOL_LIBRARY_SUFFIX ".so" 62 63 /** 64 * The maximum number of characters (COUNTING NULL TERMINATOR) to allow 65 * for protocol names within the library filename of client plugins. 66 */ 67 #define GUAC_PROTOCOL_NAME_LIMIT 256 68 69 /** 70 * The maximum number of characters (INCLUDING NULL TERMINATOR) that a 71 * character array containing the concatenation of the library prefix, 72 * protocol name, and suffix can contain, assuming the protocol name is 73 * limited to GUAC_PROTOCOL_NAME_LIMIT characters. 74 */ 75 #define GUAC_PROTOCOL_LIBRARY_LIMIT ( \ 76 \ 77 sizeof(GUAC_PROTOCOL_LIBRARY_PREFIX) - 1 /* "libguac-client-" */ \ 78 + GUAC_PROTOCOL_NAME_LIMIT - 1 /* [up to 256 chars] */ \ 79 + sizeof(GUAC_PROTOCOL_LIBRARY_SUFFIX) - 1 /* ".so" */ \ 80 + 1 /* NULL terminator */ \ 81 \ 82 ) 83 84 53 85 typedef struct guac_client guac_client; 54 86 typedef struct guac_client_plugin guac_client_plugin; -
src/client.c
rfd1164e r7dcefa7 165 165 166 166 /* Pluggable client */ 167 char protocol_lib[256] = "libguac-client-"; 168 167 char protocol_lib[GUAC_PROTOCOL_LIBRARY_LIMIT] = 168 GUAC_PROTOCOL_LIBRARY_PREFIX; 169 169 170 union { 170 171 guac_client_init_handler* client_init; … … 173 174 174 175 /* Add protocol and .so suffix to protocol_lib */ 175 str cat(protocol_lib, protocol);176 strcat(protocol_lib, ".so");176 strncat(protocol_lib, protocol, GUAC_PROTOCOL_NAME_LIMIT-1); 177 strcat(protocol_lib, GUAC_PROTOCOL_LIBRARY_SUFFIX); 177 178 178 179 /* Load client plugin */
Note: See TracChangeset
for help on using the changeset viewer.
