Changeset 194
- Timestamp:
- 12/05/07 16:26:52 (1 year ago)
- Files:
-
- xsel/trunk/configure.ac (modified) (1 diff)
- xsel/trunk/xsel.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
xsel/trunk/configure.ac
r189 r194 21 21 #AC_CHECK_LIB([X11], [XOpenDisplay]) 22 22 23 # Error out on compile warnings 24 dnl Add some useful warnings if we have gcc. 25 dnl changequote(,)dnl 26 if test "x$ac_cv_prog_gcc" = xyes ; then 27 CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Werror -g -std=gnu99 -Wdeclaration-after-statement -Wno-unused" 28 fi 29 dnl changequote([,])dnl 30 23 31 # Checks for header files. 24 32 AC_HEADER_STDC xsel/trunk/xsel.c
r192 r194 217 217 * Returns a string with a printable name for the Atom 'atom'. 218 218 */ 219 static unsignedchar *219 static char * 220 220 get_atom_name (Atom atom) 221 221 { … … 268 268 269 269 /* 270 * xs_strdup (s) 271 * 272 * strdup wrapper for unsigned char * 273 */ 274 #define xs_strdup(s) ((unsigned char *) strdup ((const char *)s)) 275 276 /* 277 * xs_strlen (s) 278 * 279 * strlen wrapper for unsigned char * 280 */ 281 #define xs_strlen(s) (strlen ((const char *) s)) 282 283 /* 284 * xs_strncpy (s) 285 * 286 * strncpy wrapper for unsigned char * 287 */ 288 #define xs_strncpy(dest,src,n) (strncpy ((char *)dest, (const char *)src, n)) 289 290 /* 270 291 * get_homedir () 271 292 * … … 488 509 return False; 489 510 } else if (format == 8) { 490 if ( *offset + length >*alloc) {511 if ((unsigned long)*offset + length > (unsigned long)*alloc) { 491 512 *alloc = *offset + length; 492 513 if ((*buffer = realloc (*buffer, *alloc)) == NULL) { … … 495 516 } 496 517 ptr = *buffer + *offset; 497 strncpy (ptr, value, length);518 xs_strncpy (ptr, value, length); 498 519 *offset += length; 499 520 print_debug (D_TRACE, "Appended %d bytes to buffer\n", length); … … 612 633 keep_waiting = False; 613 634 } else { 614 retval = strdup (value);635 retval = xs_strdup (value); 615 636 XFree (value); 616 637 keep_waiting = False; … … 700 721 unsigned char * new_sel = NULL; 701 722 702 new_sel = strdup (s);703 current_alloc = total_input = strlen (s);723 new_sel = xs_strdup (s); 724 current_alloc = total_input = xs_strlen (s); 704 725 705 726 return new_sel; … … 1267 1288 return 1268 1289 change_property (display, requestor, property, XA_STRING, 8, 1269 PropModeReplace, sel, strlen(sel),1290 PropModeReplace, sel, xs_strlen(sel), 1270 1291 selection, time, mparent); 1271 1292 } … … 1283 1304 return 1284 1305 change_property (display, requestor, property, utf8_atom, 8, 1285 PropModeReplace, sel, strlen(sel),1306 PropModeReplace, sel, xs_strlen(sel), 1286 1307 selection, time, mparent); 1287 1308 }
