summaryrefslogtreecommitdiff
path: root/net/irrtoolset-nox11/patches/patch-ct
blob: 6dac485a62f02534bce706ac7d1ac4a1fe9ee5da (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
38
39
40
41
$NetBSD: patch-ct,v 1.2 2009/02/14 16:17:06 spz Exp $

--- src/rpsl/rpsl/rptype.cc.orig	2006-06-08 17:16:26.000000000 +0200
+++ src/rpsl/rpsl/rptype.cc
@@ -254,7 +254,7 @@ Item *RPTypeWord::typeCast(const Item  *
 	 return new ItemWORD(strdup("false"));
    if (typeid(*item) == typeid(ItemASNO)) {
       char buffer[64];
-      sprintf(buffer, "AS%d", ((ItemASNO *) item)->asno);
+      asnum_string(buffer, ((ItemASNO *) item)->asno);
       return new ItemWORD(strdup(buffer));
    }
 
@@ -285,7 +285,7 @@ Item *RPTypeBlob::typeCast(const Item  *
 	 return new ItemBLOB(strdup("false"));
    if (typeid(*item) == typeid(ItemASNO)) {
       char buffer[64];
-      sprintf(buffer, "AS%d", ((ItemASNO *) item)->asno);
+      asnum_string(buffer, ((ItemASNO *) item)->asno);
       return new ItemWORD(strdup(buffer));
    }
 
@@ -367,7 +367,7 @@ Item *RPTypeEnum::typeCast(const Item  *
 	 w = new ItemWORD(strdup("false"));
    if (typeid(*item) == typeid(ItemASNO)) {
       char buffer[64];
-      sprintf(buffer, "AS%d", ((ItemASNO *) item)->asno);
+      asnum_string(buffer, ((ItemASNO *) item)->asno);
       w = new ItemWORD(strdup(buffer));
    }
 
@@ -388,8 +388,7 @@ bool RPTypeBoolean::validate(const Item 
 ////////////////////////////// RPTypeASNumber ////////////////////
 
 bool RPTypeASNumber::validate(const Item *item) const {
-   return ((typeid(*item) == typeid(ItemASNO))
-	   && ((ItemASNO *) item)->asno <= 65535);
+   return ((typeid(*item) == typeid(ItemASNO)));
 }
 
 ////////////////////////////// RPTypeIPv4Address ////////////////////