/* */
/* */
/* */
-/* (C) 2001-2009, Ullrich von Bassewitz */
+/* (C) 2001-2011, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
#include "check.h"
#include "debugflag.h"
#include "global.h"
-#include "hashstr.h"
+#include "hashfunc.h"
#include "strbuf.h"
#include "strutil.h"
#include "xmalloc.h"
* current code end)
*/
{
+ /* Transparently handle an empty range */
+ if (Count == 0) {
+ return;
+ }
+
/* If NewPos is at the end of the code segment, move any labels from the
* label pool to the first instruction of the moved range.
*/
if (CE_HasLabel (FirstEntry)) {
/* Get the entry following last */
CodeEntry* FollowingEntry = CS_GetNextEntry (S, Last);
- if (FollowingEntry) {
+ if (FollowingEntry) {
/* There is an entry after Last - move the labels */
CS_MoveLabels (S, FirstEntry, FollowingEntry);
} else {
const char* N = strchr (L, '\n');
if (N) {
/* We have a newline, just write the first part */
- WriteOutput ("%.*s\n; ", N - L, L);
+ WriteOutput ("%.*s\n; ", (int) (N - L), L);
L = N+1;
} else {
/* No Newline, write as is */