Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
971a04f1
Commit
971a04f1
authored
Jul 01, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implications of len spec change
R=r CC=golang-dev
https://golang.org/cl/1712048
parent
88f5bd94
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
8 deletions
+8
-8
src/pkg/os/dir_darwin.go
src/pkg/os/dir_darwin.go
+1
-1
src/pkg/os/dir_freebsd.go
src/pkg/os/dir_freebsd.go
+1
-1
src/pkg/os/dir_linux.go
src/pkg/os/dir_linux.go
+1
-1
src/pkg/os/dir_nacl.go
src/pkg/os/dir_nacl.go
+1
-1
src/pkg/syscall/syscall_bsd.go
src/pkg/syscall/syscall_bsd.go
+2
-2
src/pkg/syscall/syscall_linux.go
src/pkg/syscall/syscall_linux.go
+2
-2
No files found.
src/pkg/os/dir_darwin.go
View file @
971a04f1
...
...
@@ -58,7 +58,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
if
dirent
.
Ino
==
0
{
// File absent in directory.
continue
}
bytes
:=
(
*
[
len
(
dirent
.
Name
)
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
var
name
=
string
(
bytes
[
0
:
dirent
.
Namlen
])
if
name
==
"."
||
name
==
".."
{
// Useless names
continue
...
...
src/pkg/os/dir_freebsd.go
View file @
971a04f1
...
...
@@ -53,7 +53,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
if
dirent
.
Fileno
==
0
{
// File absent in directory.
continue
}
bytes
:=
(
*
[
len
(
dirent
.
Name
)
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
var
name
=
string
(
bytes
[
0
:
dirent
.
Namlen
])
if
name
==
"."
||
name
==
".."
{
// Useless names
continue
...
...
src/pkg/os/dir_linux.go
View file @
971a04f1
...
...
@@ -56,7 +56,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
if
dirent
.
Ino
==
0
{
// File absent in directory.
continue
}
bytes
:=
(
*
[
len
(
dirent
.
Name
)
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
var
name
=
string
(
bytes
[
0
:
clen
(
bytes
[
0
:
])])
if
name
==
"."
||
name
==
".."
{
// Useless names
continue
...
...
src/pkg/os/dir_nacl.go
View file @
971a04f1
...
...
@@ -56,7 +56,7 @@ func (file *File) Readdirnames(count int) (names []string, err Error) {
if
dirent
.
Ino
==
0
{
// File absent in directory.
continue
}
bytes
:=
(
*
[
len
(
dirent
.
Name
)
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
dirent
.
Name
[
0
]))
var
name
=
string
(
bytes
[
0
:
clen
(
bytes
)])
if
name
==
"."
||
name
==
".."
{
// Useless names
continue
...
...
src/pkg/syscall/syscall_bsd.go
View file @
971a04f1
...
...
@@ -239,8 +239,8 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
break
}
}
bytes
:=
(
*
[
len
(
pp
.
Path
)]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Path
[
0
]))
sa
.
Name
=
string
(
bytes
[
0
:
n
]
)
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Path
[
0
]))[
0
:
n
]
sa
.
Name
=
string
(
bytes
)
return
sa
,
0
case
AF_INET
:
...
...
src/pkg/syscall/syscall_linux.go
View file @
971a04f1
...
...
@@ -284,8 +284,8 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
for
n
<
len
(
pp
.
Path
)
&&
pp
.
Path
[
n
]
!=
0
{
n
++
}
bytes
:=
(
*
[
len
(
pp
.
Path
)]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Path
[
0
]))
sa
.
Name
=
string
(
bytes
[
0
:
n
]
)
bytes
:=
(
*
[
10000
]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Path
[
0
]))[
0
:
n
]
sa
.
Name
=
string
(
bytes
)
return
sa
,
0
case
AF_INET
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment