[RAPPS]
[reactos.git] / reactos / base / applications / rapps / richedit.c
index 79a64d6..fad3ba3 100644 (file)
@@ -8,10 +8,11 @@
 
 #include "rapps.h"
 
+#include <shlwapi.h>
+
 HWND hRichEdit;
 PWSTR pLink = NULL;
 
-
 VOID
 RichEditOnLink(HWND hwnd, ENLINK *Link)
 {
@@ -25,7 +26,7 @@ RichEditOnLink(HWND hwnd, ENLINK *Link)
             pLink = (PWSTR) HeapAlloc(GetProcessHeap(),
                                       0,
                                       (max(Link->chrg.cpMin, Link->chrg.cpMax) -
-                                       min(Link->chrg.cpMin, Link->chrg.cpMax))*sizeof(WCHAR));
+                                       min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR));
             if (!pLink)
             {
                 /* TODO: Error message */