summaryrefslogtreecommitdiff
path: root/www/firefox3/patches/patch-ea
blob: 5aac3b6027b7fa422bbf204c2a0e8333b6603c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$NetBSD: patch-ea,v 1.2 2009/01/05 09:58:36 martin Exp $

--- toolkit/components/history/src/nsGlobalHistory.cpp.orig	2006-02-02 20:55:17.000000000 +0100
+++ toolkit/components/history/src/nsGlobalHistory.cpp
@@ -322,7 +322,9 @@ matchAgeInDaysCallback(nsIMdbRow *row, v
   if (err != 0) return PR_FALSE;
   
   PRTime rowDate;
-  PR_sscanf((const char*)yarn.mYarn_Buf, "%lld", &rowDate);
+  long long ld;
+  PR_sscanf((const char*)yarn.mYarn_Buf, "%lld", &ld);
+  rowDate = ld;
 
   PRInt32 days = GetAgeInDays(matchSearchTerm->now, rowDate);
   
@@ -1067,7 +1069,9 @@ nsGlobalHistory::GetRowValue(nsIMdbRow *
   if (!yarn.mYarn_Fill || !yarn.mYarn_Buf)
     return NS_OK;
 
-  PR_sscanf((const char*)yarn.mYarn_Buf, "%lld", aResult);
+  long long ld;
+  PR_sscanf((const char*)yarn.mYarn_Buf, "%lld", &ld);
+  *aResult = ld;
   
   return NS_OK;
 }
@@ -1153,6 +1157,9 @@ nsGlobalHistory::SetPageTitle(nsIURI *aU
   rv = aURI->GetSpec(URISpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
+  if (URISpec.Length() > HISTORY_URI_LENGTH_MAX)
+    URISpec.Left(URISpec, HISTORY_URI_LENGTH_MAX);
+
   nsCOMPtr<nsIMdbRow> row;
   rv = FindRow(kToken_URLColumn, URISpec.get(), getter_AddRefs(row));