File toppler-1.1.5-no-strncpy.patch of Package toppler

diff -up toppler-1.1.5/highscore.cc.p3 toppler-1.1.5/highscore.cc
--- toppler-1.1.5/highscore.cc.p3	2011-05-03 10:13:01.439013941 +0200
+++ toppler-1.1.5/highscore.cc	2011-05-03 10:14:21.316014002 +0200
@@ -224,7 +224,7 @@ void hsc_cleanup(void)
 }
 
 void hsc_select(const char * mission) {
-  strncpy(missionname, mission, 100);
+  snprintf(missionname, sizeof(missionname), "%s", mission);
   bool locked = hsc_lock();
   loadscores();
   if (locked)
@@ -236,7 +236,7 @@ Uint8 hsc_entries(void) { return NUMHISC
 void hsc_entry(Uint8 nr, char *name, Uint32 *points, Uint8 *tower) {
 
   if (nr < NUMHISCORES) {
-    if (name) strncpy(name, scores[nr].name, SCORENAMELEN);
+    if (name) strcpy(name, scores[nr].name);
     if (points) *points = scores[nr].points;
     if (tower) *tower = scores[nr].tower;
   } else {
@@ -266,7 +266,7 @@ Uint8 hsc_enter(Uint32 points, Uint8 tow
   
     if (t < NUMHISCORES) {
   
-      strncpy(scores[t].name, name, SCORENAMELEN);
+      snprintf(scores[t].name, sizeof(scores[t].name), "%s", name);
       scores[t].points = points;
       scores[t].tower = tower;
 
openSUSE Build Service is sponsored by